n8n AI 代码工具输入输出

原名:n8n-code-tool

处理 AI 可调用 Code Tool 的参数、字符串返回和沙箱限制。

中文 Skills 技能说明

n8n 的 AI 代码工具与普通 Code 节点有不同的输入输出要求。提供工具节点版本、参数约定、错误和预期用途,技能整理 query 或结构化输入、工具名称、字符串返回及不可用帮助函数,交付工具草稿和调用测试。需要 n8n 对应 AI 节点与模型配置,模型和服务费用另计;文档中的工具不代表 Hermes 已接入。限制参数、数据范围和可执行动作,不能把模型输出直接当授权;外部请求、写库和发布需明确批准,失败结果如实返回。

上游能力依据

上游原始适用说明: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.

上游 SKILL.md 主要章节(保留原文标题):

使用边界

先核对运行环境、账号、区域、依赖和最小权限。创建资源、改配置、发布服务或产生费用前必须让使用者确认。

作者、翻译与许可证

原作者
Romuald Członkowski 与 n8n-skills contributors
中文翻译
CEOFans翻译
许可证
MIT
上游来源
https://github.com/czlonkowski/n8n-skills/tree/e037563e101749e630e6688d121d04529fe6ee7b/skills/n8n-code-tool

适用范围

平台:linux、macos、windows;标签:MCP 与工具、n8n AI 代码工具输入输出、开源技能

安全提示

基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。

如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。