N8n Code Tool skill for Claude
Write JavaScript or Python for the n8n Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode) — the AI-agent-callable tool, NOT the workflow Code node.
When Claude uses it
Use when building a Code Tool attached to an AI Agent, writing code that an LLM will invoke, parsing the `query` input, returning a string result, defining an input schema for structured arguments (specifyInputSchema, jsonSchemaExample, DynamicStructuredTool), or troubleshooting errors like \"Wrong output type returned\", \"No execution data available\", \"The response property should be a string, but it is an object\", \"Cannot assign to read only property 'name'\", or an AI agent that refuses to call the tool. Covers the critical differences between Code node and Code Tool: return format (string vs `[{json:{...}}]`), unavailability of `$fromAI`/`$input`/`$helpers` in the Code Tool sandbox, naming rules for AI invocation, and when to use `toolWorkflow`/HTTP Request Tool instead.
N8n Code Tool SKILL.md
A preview of the skill file from WilkoMarketing/antigravity-n8n-skills.
n8n Custom Code Tool
Expert guidance for writing code inside @n8n/n8n-nodes-langchain.toolCode — the tool an AI Agent can invoke, not the regular workflow Code node.
⚠️ This is NOT the Code node
The Custom Code Tool looks like a Code node in the editor — same JavaScript editor, similar layout — but it is a completely different node from a different package with a different runtime contract.
| Code node | Custom Code Tool | |
|---|---|---|
| Node type | n8n-nodes-base.code | @n8n/n8n-nodes-langchain.toolCode |
| Package | n8n-nodes-base | @n8n/n8n-nodes-langchain |
| Invoked by | Previous node (workflow flow) | AI Agent (LangChain) |
| Input | $input.all() — item stream | query — string or object from LLM |
| Return | [{json: {...}}] (items array) | A string |
$fromAI() | N/A | Not available (see Errors) |
| HTTP helper | this.helpers.httpRequest (auth helpers blocked) | Not exposed to the tool sandbox |
| State | Per-run execution data | No getContext, no $getWorkflowStaticData |
If you treat it like a Code node, it fails. The rest of this skill covers the Code Tool's actual contract.
How to install N8n Code Tool
Claude Code
Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):
npx degit WilkoMarketing/antigravity-n8n-skills/n8n-code-tool#main ~/.claude/skills/n8n-code-toolCodex
npx degit WilkoMarketing/antigravity-n8n-skills/n8n-code-tool#main ~/.codex/skills/n8n-code-toolClaude.ai and Claude Desktop
Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.
Frequently asked questions
+What does the N8n Code Tool skill do?
Write JavaScript or Python for the n8n Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode) — the AI-agent-callable tool, NOT the workflow Code node. Use when building a Code Tool attached to an AI Agent, writing code that an LLM will invoke, parsing the `query` input, returning a string result, defining an input schema for structured arguments (specifyInputSchema, jsonSchemaExample, DynamicStructuredTool), or troubleshooting errors like \"Wrong output type returned\", \"No execution data available\", \"The response property should be a string, but it is an object\", \"Cannot assign to read only property 'name'\", or an AI agent that refuses to call the tool. Covers the critical differences between Code node and Code Tool: return format (string vs `[{json:{...}}]`), unavailability of `$fromAI`/`$input`/`$helpers` in the Code Tool sandbox, naming rules for AI invocation, and when to use `toolWorkflow`/HTTP Request Tool instead.
+How do I install N8n Code Tool in Claude Code?
Copy the skill folder into ~/.claude/skills/n8n-code-tool, for example with "npx degit WilkoMarketing/antigravity-n8n-skills/n8n-code-tool#main ~/.claude/skills/n8n-code-tool". Claude Code loads it automatically and uses it when a task matches.
+Does N8n Code Tool work with ChatGPT or Codex?
Yes. N8n Code Tool uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/n8n-code-tool. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.
+Is N8n Code Tool free?
N8n Code Tool is published on GitHub by WilkoMarketing. The repository does not declare a license, so check with the author before reusing it.