What problem does it solve?
Developers frequently confuse the n8n Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode) with the regular Code node, causing cryptic runtime errors like "Wrong output type returned" and "No execution data available" when building AI-agent-callable tools.
Core Features & Use Cases
- Contract Clarification: Teaches the Code Tool's string-in/string-out contract, the
query/_query input variable, and which sandbox helpers ($fromAI, $input, $helpers) are unavailable.
- Structured Input Schemas: Explains how to enable specifyInputSchema with fromJson or manual JSON Schema so the LLM passes validated typed arguments instead of free-form strings.
- Error Catalog: Maps the signature runtime errors to exact causes and fixes, including AI agents that never invoke the tool due to generic names or vague descriptions.
- Use Case: You attach a Code Tool to an AI Agent to calculate loan payments; this skill shows how to name the tool, parse the query input, return JSON.stringify output, and avoid $fromAI() misuse.
Quick Start
Ask the AI to write an n8n Custom Code Tool that reads the query input and returns a JSON-stringified result for your AI Agent workflow.