n8n-mcp 2.7.15 → 2.7.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/.env.example +1 -0
  2. package/README.md +64 -23
  3. package/data/nodes.db +0 -0
  4. package/dist/http-server-single-session.d.ts.map +1 -1
  5. package/dist/http-server-single-session.js +18 -0
  6. package/dist/http-server-single-session.js.map +1 -1
  7. package/dist/http-server.d.ts.map +1 -1
  8. package/dist/http-server.js +18 -0
  9. package/dist/http-server.js.map +1 -1
  10. package/dist/mcp/handlers-n8n-manager.d.ts.map +1 -1
  11. package/dist/mcp/handlers-n8n-manager.js +28 -5
  12. package/dist/mcp/handlers-n8n-manager.js.map +1 -1
  13. package/dist/mcp/server.d.ts +1 -0
  14. package/dist/mcp/server.d.ts.map +1 -1
  15. package/dist/mcp/server.js +114 -77
  16. package/dist/mcp/server.js.map +1 -1
  17. package/dist/mcp/stdio-wrapper.js +30 -1
  18. package/dist/mcp/stdio-wrapper.js.map +1 -1
  19. package/dist/mcp/tool-docs/configuration/get-node-as-tool-info.d.ts +3 -0
  20. package/dist/mcp/tool-docs/configuration/get-node-as-tool-info.d.ts.map +1 -0
  21. package/dist/mcp/tool-docs/configuration/get-node-as-tool-info.js +73 -0
  22. package/dist/mcp/tool-docs/configuration/get-node-as-tool-info.js.map +1 -0
  23. package/dist/mcp/tool-docs/configuration/get-node-documentation.d.ts +3 -0
  24. package/dist/mcp/tool-docs/configuration/get-node-documentation.d.ts.map +1 -0
  25. package/dist/mcp/tool-docs/configuration/get-node-documentation.js +47 -0
  26. package/dist/mcp/tool-docs/configuration/get-node-documentation.js.map +1 -0
  27. package/dist/mcp/tool-docs/configuration/get-node-essentials.d.ts +3 -0
  28. package/dist/mcp/tool-docs/configuration/get-node-essentials.d.ts.map +1 -0
  29. package/dist/mcp/tool-docs/configuration/get-node-essentials.js +88 -0
  30. package/dist/mcp/tool-docs/configuration/get-node-essentials.js.map +1 -0
  31. package/dist/mcp/tool-docs/configuration/get-node-info.d.ts +3 -0
  32. package/dist/mcp/tool-docs/configuration/get-node-info.d.ts.map +1 -0
  33. package/dist/mcp/tool-docs/configuration/get-node-info.js +100 -0
  34. package/dist/mcp/tool-docs/configuration/get-node-info.js.map +1 -0
  35. package/dist/mcp/tool-docs/configuration/get-property-dependencies.d.ts +3 -0
  36. package/dist/mcp/tool-docs/configuration/get-property-dependencies.d.ts.map +1 -0
  37. package/dist/mcp/tool-docs/configuration/get-property-dependencies.js +81 -0
  38. package/dist/mcp/tool-docs/configuration/get-property-dependencies.js.map +1 -0
  39. package/dist/mcp/tool-docs/configuration/index.d.ts +7 -0
  40. package/dist/mcp/tool-docs/configuration/index.d.ts.map +1 -0
  41. package/dist/mcp/tool-docs/configuration/index.js +16 -0
  42. package/dist/mcp/tool-docs/configuration/index.js.map +1 -0
  43. package/dist/mcp/tool-docs/configuration/search-node-properties.d.ts +3 -0
  44. package/dist/mcp/tool-docs/configuration/search-node-properties.d.ts.map +1 -0
  45. package/dist/mcp/tool-docs/configuration/search-node-properties.js +99 -0
  46. package/dist/mcp/tool-docs/configuration/search-node-properties.js.map +1 -0
  47. package/dist/mcp/tool-docs/discovery/get-database-statistics.d.ts +3 -0
  48. package/dist/mcp/tool-docs/discovery/get-database-statistics.d.ts.map +1 -0
  49. package/dist/mcp/tool-docs/discovery/get-database-statistics.js +69 -0
  50. package/dist/mcp/tool-docs/discovery/get-database-statistics.js.map +1 -0
  51. package/dist/mcp/tool-docs/discovery/index.d.ts +5 -0
  52. package/dist/mcp/tool-docs/discovery/index.d.ts.map +1 -0
  53. package/dist/mcp/tool-docs/discovery/index.js +12 -0
  54. package/dist/mcp/tool-docs/discovery/index.js.map +1 -0
  55. package/dist/mcp/tool-docs/discovery/list-ai-tools.d.ts +3 -0
  56. package/dist/mcp/tool-docs/discovery/list-ai-tools.d.ts.map +1 -0
  57. package/dist/mcp/tool-docs/discovery/list-ai-tools.js +49 -0
  58. package/dist/mcp/tool-docs/discovery/list-ai-tools.js.map +1 -0
  59. package/dist/mcp/tool-docs/discovery/list-nodes.d.ts +3 -0
  60. package/dist/mcp/tool-docs/discovery/list-nodes.d.ts.map +1 -0
  61. package/dist/mcp/tool-docs/discovery/list-nodes.js +54 -0
  62. package/dist/mcp/tool-docs/discovery/list-nodes.js.map +1 -0
  63. package/dist/mcp/tool-docs/discovery/search-nodes.d.ts +3 -0
  64. package/dist/mcp/tool-docs/discovery/search-nodes.d.ts.map +1 -0
  65. package/dist/mcp/tool-docs/discovery/search-nodes.js +56 -0
  66. package/dist/mcp/tool-docs/discovery/search-nodes.js.map +1 -0
  67. package/dist/mcp/tool-docs/index.d.ts +4 -0
  68. package/dist/mcp/tool-docs/index.d.ts.map +1 -0
  69. package/dist/mcp/tool-docs/index.js +51 -0
  70. package/dist/mcp/tool-docs/index.js.map +1 -0
  71. package/dist/mcp/tool-docs/special/code-node-guide.d.ts +3 -0
  72. package/dist/mcp/tool-docs/special/code-node-guide.d.ts.map +1 -0
  73. package/dist/mcp/tool-docs/special/code-node-guide.js +61 -0
  74. package/dist/mcp/tool-docs/special/code-node-guide.js.map +1 -0
  75. package/dist/mcp/tool-docs/special/index.d.ts +2 -0
  76. package/dist/mcp/tool-docs/special/index.d.ts.map +1 -0
  77. package/dist/mcp/tool-docs/special/index.js +6 -0
  78. package/dist/mcp/tool-docs/special/index.js.map +1 -0
  79. package/dist/mcp/tool-docs/system/index.d.ts +5 -0
  80. package/dist/mcp/tool-docs/system/index.d.ts.map +1 -0
  81. package/dist/mcp/tool-docs/system/index.js +12 -0
  82. package/dist/mcp/tool-docs/system/index.js.map +1 -0
  83. package/dist/mcp/tool-docs/system/n8n-diagnostic.d.ts +3 -0
  84. package/dist/mcp/tool-docs/system/n8n-diagnostic.d.ts.map +1 -0
  85. package/dist/mcp/tool-docs/system/n8n-diagnostic.js +81 -0
  86. package/dist/mcp/tool-docs/system/n8n-diagnostic.js.map +1 -0
  87. package/dist/mcp/tool-docs/system/n8n-health-check.d.ts +3 -0
  88. package/dist/mcp/tool-docs/system/n8n-health-check.d.ts.map +1 -0
  89. package/dist/mcp/tool-docs/system/n8n-health-check.js +77 -0
  90. package/dist/mcp/tool-docs/system/n8n-health-check.js.map +1 -0
  91. package/dist/mcp/tool-docs/system/n8n-list-available-tools.d.ts +3 -0
  92. package/dist/mcp/tool-docs/system/n8n-list-available-tools.d.ts.map +1 -0
  93. package/dist/mcp/tool-docs/system/n8n-list-available-tools.js +75 -0
  94. package/dist/mcp/tool-docs/system/n8n-list-available-tools.js.map +1 -0
  95. package/dist/mcp/tool-docs/system/tools-documentation.d.ts +3 -0
  96. package/dist/mcp/tool-docs/system/tools-documentation.d.ts.map +1 -0
  97. package/dist/mcp/tool-docs/system/tools-documentation.js +65 -0
  98. package/dist/mcp/tool-docs/system/tools-documentation.js.map +1 -0
  99. package/dist/mcp/tool-docs/templates/get-node-for-task.d.ts +3 -0
  100. package/dist/mcp/tool-docs/templates/get-node-for-task.d.ts.map +1 -0
  101. package/dist/mcp/tool-docs/templates/get-node-for-task.js +50 -0
  102. package/dist/mcp/tool-docs/templates/get-node-for-task.js.map +1 -0
  103. package/dist/mcp/tool-docs/templates/get-template.d.ts +3 -0
  104. package/dist/mcp/tool-docs/templates/get-template.d.ts.map +1 -0
  105. package/dist/mcp/tool-docs/templates/get-template.js +76 -0
  106. package/dist/mcp/tool-docs/templates/get-template.js.map +1 -0
  107. package/dist/mcp/tool-docs/templates/get-templates-for-task.d.ts +3 -0
  108. package/dist/mcp/tool-docs/templates/get-templates-for-task.d.ts.map +1 -0
  109. package/dist/mcp/tool-docs/templates/get-templates-for-task.js +76 -0
  110. package/dist/mcp/tool-docs/templates/get-templates-for-task.js.map +1 -0
  111. package/dist/mcp/tool-docs/templates/index.d.ts +7 -0
  112. package/dist/mcp/tool-docs/templates/index.d.ts.map +1 -0
  113. package/dist/mcp/tool-docs/templates/index.js +16 -0
  114. package/dist/mcp/tool-docs/templates/index.js.map +1 -0
  115. package/dist/mcp/tool-docs/templates/list-node-templates.d.ts +3 -0
  116. package/dist/mcp/tool-docs/templates/list-node-templates.d.ts.map +1 -0
  117. package/dist/mcp/tool-docs/templates/list-node-templates.js +80 -0
  118. package/dist/mcp/tool-docs/templates/list-node-templates.js.map +1 -0
  119. package/dist/mcp/tool-docs/templates/list-tasks.d.ts +3 -0
  120. package/dist/mcp/tool-docs/templates/list-tasks.d.ts.map +1 -0
  121. package/dist/mcp/tool-docs/templates/list-tasks.js +48 -0
  122. package/dist/mcp/tool-docs/templates/list-tasks.js.map +1 -0
  123. package/dist/mcp/tool-docs/templates/search-templates.d.ts +3 -0
  124. package/dist/mcp/tool-docs/templates/search-templates.d.ts.map +1 -0
  125. package/dist/mcp/tool-docs/templates/search-templates.js +83 -0
  126. package/dist/mcp/tool-docs/templates/search-templates.js.map +1 -0
  127. package/dist/mcp/tool-docs/types.d.ts +30 -0
  128. package/dist/mcp/tool-docs/types.d.ts.map +1 -0
  129. package/dist/mcp/tool-docs/types.js +3 -0
  130. package/dist/mcp/tool-docs/types.js.map +1 -0
  131. package/dist/mcp/tool-docs/validation/index.d.ts +6 -0
  132. package/dist/mcp/tool-docs/validation/index.d.ts.map +1 -0
  133. package/dist/mcp/tool-docs/validation/index.js +14 -0
  134. package/dist/mcp/tool-docs/validation/index.js.map +1 -0
  135. package/dist/mcp/tool-docs/validation/validate-node-minimal.d.ts +3 -0
  136. package/dist/mcp/tool-docs/validation/validate-node-minimal.d.ts.map +1 -0
  137. package/dist/mcp/tool-docs/validation/validate-node-minimal.js +49 -0
  138. package/dist/mcp/tool-docs/validation/validate-node-minimal.js.map +1 -0
  139. package/dist/mcp/tool-docs/validation/validate-node-operation.d.ts +3 -0
  140. package/dist/mcp/tool-docs/validation/validate-node-operation.d.ts.map +1 -0
  141. package/dist/mcp/tool-docs/validation/validate-node-operation.js +94 -0
  142. package/dist/mcp/tool-docs/validation/validate-node-operation.js.map +1 -0
  143. package/dist/mcp/tool-docs/validation/validate-workflow-connections.d.ts +3 -0
  144. package/dist/mcp/tool-docs/validation/validate-workflow-connections.d.ts.map +1 -0
  145. package/dist/mcp/tool-docs/validation/validate-workflow-connections.js +58 -0
  146. package/dist/mcp/tool-docs/validation/validate-workflow-connections.js.map +1 -0
  147. package/dist/mcp/tool-docs/validation/validate-workflow-expressions.d.ts +3 -0
  148. package/dist/mcp/tool-docs/validation/validate-workflow-expressions.d.ts.map +1 -0
  149. package/dist/mcp/tool-docs/validation/validate-workflow-expressions.js +58 -0
  150. package/dist/mcp/tool-docs/validation/validate-workflow-expressions.js.map +1 -0
  151. package/dist/mcp/tool-docs/validation/validate-workflow.d.ts +3 -0
  152. package/dist/mcp/tool-docs/validation/validate-workflow.d.ts.map +1 -0
  153. package/dist/mcp/tool-docs/validation/validate-workflow.js +83 -0
  154. package/dist/mcp/tool-docs/validation/validate-workflow.js.map +1 -0
  155. package/dist/mcp/tool-docs/workflow_management/index.d.ts +15 -0
  156. package/dist/mcp/tool-docs/workflow_management/index.d.ts.map +1 -0
  157. package/dist/mcp/tool-docs/workflow_management/index.js +32 -0
  158. package/dist/mcp/tool-docs/workflow_management/index.js.map +1 -0
  159. package/dist/mcp/tool-docs/workflow_management/n8n-create-workflow.d.ts +3 -0
  160. package/dist/mcp/tool-docs/workflow_management/n8n-create-workflow.d.ts.map +1 -0
  161. package/dist/mcp/tool-docs/workflow_management/n8n-create-workflow.js +99 -0
  162. package/dist/mcp/tool-docs/workflow_management/n8n-create-workflow.js.map +1 -0
  163. package/dist/mcp/tool-docs/workflow_management/n8n-delete-execution.d.ts +3 -0
  164. package/dist/mcp/tool-docs/workflow_management/n8n-delete-execution.d.ts.map +1 -0
  165. package/dist/mcp/tool-docs/workflow_management/n8n-delete-execution.js +59 -0
  166. package/dist/mcp/tool-docs/workflow_management/n8n-delete-execution.js.map +1 -0
  167. package/dist/mcp/tool-docs/workflow_management/n8n-delete-workflow.d.ts +3 -0
  168. package/dist/mcp/tool-docs/workflow_management/n8n-delete-workflow.d.ts.map +1 -0
  169. package/dist/mcp/tool-docs/workflow_management/n8n-delete-workflow.js +52 -0
  170. package/dist/mcp/tool-docs/workflow_management/n8n-delete-workflow.js.map +1 -0
  171. package/dist/mcp/tool-docs/workflow_management/n8n-get-execution.d.ts +3 -0
  172. package/dist/mcp/tool-docs/workflow_management/n8n-get-execution.d.ts.map +1 -0
  173. package/dist/mcp/tool-docs/workflow_management/n8n-get-execution.js +64 -0
  174. package/dist/mcp/tool-docs/workflow_management/n8n-get-execution.js.map +1 -0
  175. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-details.d.ts +3 -0
  176. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-details.d.ts.map +1 -0
  177. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-details.js +51 -0
  178. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-details.js.map +1 -0
  179. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-minimal.d.ts +3 -0
  180. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-minimal.d.ts.map +1 -0
  181. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-minimal.js +51 -0
  182. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-minimal.js.map +1 -0
  183. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-structure.d.ts +3 -0
  184. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-structure.d.ts.map +1 -0
  185. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-structure.js +51 -0
  186. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow-structure.js.map +1 -0
  187. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow.d.ts +3 -0
  188. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow.d.ts.map +1 -0
  189. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow.js +51 -0
  190. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow.js.map +1 -0
  191. package/dist/mcp/tool-docs/workflow_management/n8n-list-executions.d.ts +3 -0
  192. package/dist/mcp/tool-docs/workflow_management/n8n-list-executions.d.ts.map +1 -0
  193. package/dist/mcp/tool-docs/workflow_management/n8n-list-executions.js +86 -0
  194. package/dist/mcp/tool-docs/workflow_management/n8n-list-executions.js.map +1 -0
  195. package/dist/mcp/tool-docs/workflow_management/n8n-list-workflows.d.ts +3 -0
  196. package/dist/mcp/tool-docs/workflow_management/n8n-list-workflows.d.ts.map +1 -0
  197. package/dist/mcp/tool-docs/workflow_management/n8n-list-workflows.js +57 -0
  198. package/dist/mcp/tool-docs/workflow_management/n8n-list-workflows.js.map +1 -0
  199. package/dist/mcp/tool-docs/workflow_management/n8n-trigger-webhook-workflow.d.ts +3 -0
  200. package/dist/mcp/tool-docs/workflow_management/n8n-trigger-webhook-workflow.d.ts.map +1 -0
  201. package/dist/mcp/tool-docs/workflow_management/n8n-trigger-webhook-workflow.js +80 -0
  202. package/dist/mcp/tool-docs/workflow_management/n8n-trigger-webhook-workflow.js.map +1 -0
  203. package/dist/mcp/tool-docs/workflow_management/n8n-update-full-workflow.d.ts +3 -0
  204. package/dist/mcp/tool-docs/workflow_management/n8n-update-full-workflow.d.ts.map +1 -0
  205. package/dist/mcp/tool-docs/workflow_management/n8n-update-full-workflow.js +57 -0
  206. package/dist/mcp/tool-docs/workflow_management/n8n-update-full-workflow.js.map +1 -0
  207. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.d.ts +3 -0
  208. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.d.ts.map +1 -0
  209. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.js +82 -0
  210. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.js.map +1 -0
  211. package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.d.ts +3 -0
  212. package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.d.ts.map +1 -0
  213. package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.js +73 -0
  214. package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.js.map +1 -0
  215. package/dist/mcp/tools-documentation-new.d.ts +6 -0
  216. package/dist/mcp/tools-documentation-new.d.ts.map +1 -0
  217. package/dist/mcp/tools-documentation-new.js +163 -0
  218. package/dist/mcp/tools-documentation-new.js.map +1 -0
  219. package/dist/mcp/tools-documentation.d.ts +1 -29
  220. package/dist/mcp/tools-documentation.d.ts.map +1 -1
  221. package/dist/mcp/tools-documentation.js +516 -1235
  222. package/dist/mcp/tools-documentation.js.map +1 -1
  223. package/dist/mcp/tools-n8n-manager.js +2 -2
  224. package/dist/mcp/tools-n8n-manager.js.map +1 -1
  225. package/dist/scripts/rebuild.js +2 -1
  226. package/dist/scripts/rebuild.js.map +1 -1
  227. package/dist/scripts/test-issue-74.d.ts +3 -0
  228. package/dist/scripts/test-issue-74.d.ts.map +1 -0
  229. package/dist/scripts/test-issue-74.js +112 -0
  230. package/dist/scripts/test-issue-74.js.map +1 -0
  231. package/dist/scripts/test-tools-documentation.d.ts +2 -0
  232. package/dist/scripts/test-tools-documentation.d.ts.map +1 -0
  233. package/dist/scripts/test-tools-documentation.js +41 -0
  234. package/dist/scripts/test-tools-documentation.js.map +1 -0
  235. package/dist/scripts/test-updatenode-null-fix.d.ts +3 -0
  236. package/dist/scripts/test-updatenode-null-fix.d.ts.map +1 -0
  237. package/dist/scripts/test-updatenode-null-fix.js +156 -0
  238. package/dist/scripts/test-updatenode-null-fix.js.map +1 -0
  239. package/dist/services/enhanced-config-validator.d.ts +0 -1
  240. package/dist/services/enhanced-config-validator.d.ts.map +1 -1
  241. package/dist/services/enhanced-config-validator.js +2 -91
  242. package/dist/services/enhanced-config-validator.js.map +1 -1
  243. package/dist/services/n8n-api-client.d.ts.map +1 -1
  244. package/dist/services/n8n-api-client.js +13 -2
  245. package/dist/services/n8n-api-client.js.map +1 -1
  246. package/dist/services/workflow-validator.js +1 -1
  247. package/dist/services/workflow-validator.js.map +1 -1
  248. package/dist/utils/node-utils.d.ts +4 -0
  249. package/dist/utils/node-utils.d.ts.map +1 -0
  250. package/dist/utils/node-utils.js +78 -0
  251. package/dist/utils/node-utils.js.map +1 -0
  252. package/dist/utils/version-utils.d.ts +16 -0
  253. package/dist/utils/version-utils.d.ts.map +1 -0
  254. package/dist/utils/version-utils.js +129 -0
  255. package/dist/utils/version-utils.js.map +1 -0
  256. package/package.json +1 -1
@@ -1,1389 +1,670 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toolsDocumentation = void 0;
4
3
  exports.getToolDocumentation = getToolDocumentation;
5
4
  exports.getToolsOverview = getToolsOverview;
6
5
  exports.searchToolDocumentation = searchToolDocumentation;
7
6
  exports.getToolsByCategory = getToolsByCategory;
8
7
  exports.getAllCategories = getAllCategories;
9
- exports.toolsDocumentation = {
10
- search_nodes: {
11
- name: 'search_nodes',
12
- category: 'discovery',
13
- essentials: {
14
- description: 'Search nodes. Primary nodes ranked first.',
15
- keyParameters: ['query', 'limit', 'mode'],
16
- example: 'search_nodes({query: "webhook"})',
17
- performance: 'Fast - FTS5 when available',
18
- tips: [
19
- 'Primary nodes first: webhook→Webhook, http→HTTP Request',
20
- 'Modes: OR (any word), AND (all words), FUZZY (typos OK)'
21
- ]
22
- },
23
- full: {
24
- description: 'Search n8n nodes using FTS5 full-text search (when available) with relevance ranking. Supports OR (default), AND, and FUZZY search modes. Results are sorted by relevance, ensuring primary nodes like Webhook and HTTP Request appear first.',
25
- parameters: {
26
- query: { type: 'string', description: 'Search terms. Wrap in quotes for exact phrase matching', required: true },
27
- limit: { type: 'number', description: 'Maximum results to return (default: 20)', required: false },
28
- mode: { type: 'string', description: 'Search mode: OR (any word), AND (all words in ANY field), FUZZY (typo-tolerant using edit distance)', required: false }
29
- },
30
- returns: 'Array of nodes sorted by relevance with nodeType, displayName, description, category. AND mode includes searchInfo explaining the search scope.',
31
- examples: [
32
- 'search_nodes({query: "webhook"}) - Webhook node appears first',
33
- 'search_nodes({query: "http call"}) - HTTP Request node appears first',
34
- 'search_nodes({query: "send message", mode: "AND"}) - Nodes with both words anywhere in their data',
35
- 'search_nodes({query: "slak", mode: "FUZZY"}) - Finds Slack using typo tolerance'
36
- ],
37
- useCases: [
38
- 'Finding primary nodes quickly (webhook, http, email)',
39
- 'Discovering nodes with typo tolerance',
40
- 'Precise searches with AND mode',
41
- 'Exploratory searches with OR mode'
42
- ],
43
- performance: 'FTS5: <20ms for most queries. Falls back to optimized LIKE queries if FTS5 unavailable.',
44
- bestPractices: [
45
- 'Default OR mode is best for exploration',
46
- 'Use AND mode when you need all terms present',
47
- 'Use FUZZY mode if unsure of spelling',
48
- 'Quotes force exact phrase matching',
49
- 'Primary nodes are boosted in relevance'
50
- ],
51
- pitfalls: [
52
- 'AND mode searches ALL fields (description, documentation, operations) not just names',
53
- 'FUZZY mode uses edit distance - may return unexpected matches for very short queries',
54
- 'Special characters are ignored in search',
55
- 'FTS5 syntax errors fallback to basic LIKE search'
56
- ],
57
- relatedTools: ['list_nodes', 'get_node_essentials', 'get_node_info']
58
- }
59
- },
60
- get_node_essentials: {
61
- name: 'get_node_essentials',
62
- category: 'configuration',
63
- essentials: {
64
- description: 'Get 10-20 key properties with examples',
65
- keyParameters: ['nodeType'],
66
- example: 'get_node_essentials("nodes-base.slack")',
67
- performance: '<5KB vs 100KB+',
68
- tips: [
69
- 'Use this first! Has examples.'
70
- ]
71
- },
72
- full: {
73
- description: 'Returns a curated set of essential properties for a node, typically 10-20 most commonly used properties. Includes working examples and is 95% smaller than get_node_info. Designed for efficient node configuration.',
74
- parameters: {
75
- nodeType: { type: 'string', description: 'Full node type (e.g., "n8n-nodes-base.slack")', required: true }
76
- },
77
- returns: 'Object with node info, essential properties, examples, and common patterns',
78
- examples: [
79
- 'get_node_essentials("n8n-nodes-base.httpRequest") - Get HTTP request essentials',
80
- 'get_node_essentials("n8n-nodes-base.webhook") - Get webhook configuration',
81
- 'get_node_essentials("n8n-nodes-base.slack") - Get Slack essentials'
82
- ],
83
- useCases: [
84
- 'Quickly configuring nodes without information overload',
85
- 'Getting working examples for immediate use',
86
- 'Understanding the most important node options',
87
- 'Building workflows efficiently'
88
- ],
89
- performance: 'Extremely fast - returns pre-filtered data. Response size <5KB vs 100KB+ for full node info.',
90
- bestPractices: [
91
- 'Always try this before get_node_info',
92
- 'Use included examples as starting points',
93
- 'Check commonPatterns for typical configurations',
94
- 'Combine with validate_node_minimal for quick validation'
95
- ],
96
- pitfalls: [
97
- 'May not include rarely-used properties',
98
- 'Some advanced options might be missing',
99
- 'Use search_node_properties if specific property not found'
100
- ],
101
- relatedTools: ['get_node_info', 'search_node_properties', 'validate_node_minimal']
102
- }
103
- },
104
- list_nodes: {
105
- name: 'list_nodes',
106
- category: 'discovery',
107
- essentials: {
108
- description: 'List all available n8n nodes with optional filtering',
109
- keyParameters: ['category', 'limit', 'onlyTriggers'],
110
- example: 'list_nodes({category: "communication", limit: 20})',
111
- performance: 'Fast - direct database query',
112
- tips: [
113
- 'Great for browsing nodes by category',
114
- 'Use onlyTriggers:true to find workflow starters'
115
- ]
116
- },
117
- full: {
118
- description: 'Lists all available n8n nodes with comprehensive filtering options. Can filter by category, package, trigger status, and more. Returns complete node metadata.',
119
- parameters: {
120
- category: { type: 'string', description: 'Filter by category (e.g., "communication", "data")', required: false },
121
- limit: { type: 'number', description: 'Maximum results (default: 50)', required: false },
122
- offset: { type: 'number', description: 'Pagination offset', required: false },
123
- onlyTriggers: { type: 'boolean', description: 'Only show trigger nodes', required: false },
124
- onlyAITools: { type: 'boolean', description: 'Only show AI-capable nodes', required: false },
125
- package: { type: 'string', description: 'Filter by package name', required: false }
126
- },
127
- returns: 'Array of nodes with complete metadata including type, name, description, category',
128
- examples: [
129
- 'list_nodes() - Get first 50 nodes',
130
- 'list_nodes({category: "trigger"}) - All trigger nodes',
131
- 'list_nodes({onlyAITools: true}) - Nodes marked as AI tools',
132
- 'list_nodes({package: "n8n-nodes-base", limit: 100}) - Core nodes'
133
- ],
134
- useCases: [
135
- 'Browsing available nodes by category',
136
- 'Finding all triggers or webhooks',
137
- 'Discovering AI-capable nodes',
138
- 'Getting overview of available integrations'
139
- ],
140
- performance: 'Fast - uses indexed queries. Returns in <100ms even for large result sets.',
141
- bestPractices: [
142
- 'Use categories for focused browsing',
143
- 'Combine with search_nodes for keyword search',
144
- 'Use pagination for large result sets',
145
- 'Check onlyTriggers for workflow starting points'
146
- ],
147
- pitfalls: [
148
- 'No text search - use search_nodes for that',
149
- 'Categories are predefined, not all nodes have them',
150
- 'Large result sets without limit can be overwhelming'
151
- ],
152
- relatedTools: ['search_nodes', 'list_ai_tools', 'get_node_essentials']
153
- }
154
- },
155
- validate_node_minimal: {
156
- name: 'validate_node_minimal',
157
- category: 'validation',
158
- essentials: {
159
- description: 'Quick validation checking only required fields',
160
- keyParameters: ['nodeType', 'config'],
161
- example: 'validate_node_minimal("n8n-nodes-base.slack", {resource: "message", operation: "post"})',
162
- performance: 'Very fast - minimal checks only',
163
- tips: [
164
- 'Use for quick validation during configuration',
165
- 'Follow up with validate_node_operation for full validation'
166
- ]
167
- },
168
- full: {
169
- description: 'Performs minimal validation checking only required fields. Fastest validation option, perfect for iterative configuration. Checks if all required fields are present without complex dependency validation.',
170
- parameters: {
171
- nodeType: { type: 'string', description: 'Full node type', required: true },
172
- config: { type: 'object', description: 'Node configuration to validate', required: true }
173
- },
174
- returns: 'Object with isValid boolean, missing required fields, and basic feedback',
175
- examples: [
176
- 'validate_node_minimal("n8n-nodes-base.httpRequest", {url: "https://api.example.com"})',
177
- 'validate_node_minimal("n8n-nodes-base.slack", {resource: "message", operation: "post", channel: "general"})'
178
- ],
179
- useCases: [
180
- 'Quick validation during iterative configuration',
181
- 'Checking if minimum requirements are met',
182
- 'Fast feedback loop while building',
183
- 'Pre-validation before full check'
184
- ],
185
- performance: 'Extremely fast - only checks required fields. Typically <10ms.',
186
- bestPractices: [
187
- 'Use during configuration for quick feedback',
188
- 'Follow with validate_node_operation for complete validation',
189
- 'Great for iterative development',
190
- 'Combine with get_node_essentials for requirements'
191
- ],
192
- pitfalls: [
193
- 'Doesn\'t check field dependencies',
194
- 'Won\'t catch configuration conflicts',
195
- 'Missing optional but recommended fields'
196
- ],
197
- relatedTools: ['validate_node_operation', 'get_node_essentials', 'validate_workflow']
198
- }
199
- },
200
- validate_node_operation: {
201
- name: 'validate_node_operation',
202
- category: 'validation',
203
- essentials: {
204
- description: 'Full validation with operation-aware checking and helpful suggestions',
205
- keyParameters: ['nodeType', 'config', 'profile'],
206
- example: 'validate_node_operation("n8n-nodes-base.slack", {resource: "message", operation: "post", channel: "general"})',
207
- performance: 'Moderate - comprehensive validation',
208
- tips: [
209
- 'Provides specific error messages and fixes',
210
- 'Use "strict" profile for production workflows'
211
- ]
212
- },
213
- full: {
214
- description: 'Comprehensive validation that understands operation-specific requirements. Checks dependencies, validates field values, and provides helpful suggestions for fixing issues.',
215
- parameters: {
216
- nodeType: { type: 'string', description: 'Full node type', required: true },
217
- config: { type: 'object', description: 'Complete node configuration', required: true },
218
- profile: { type: 'string', description: 'Validation profile: "development" or "strict"', required: false }
219
- },
220
- returns: 'Detailed validation results with errors, warnings, suggestions, and fixes',
221
- examples: [
222
- 'validate_node_operation("n8n-nodes-base.httpRequest", {method: "POST", url: "{{$json.url}}", bodyParametersUi: {...}})',
223
- 'validate_node_operation("n8n-nodes-base.postgres", {operation: "executeQuery", query: "SELECT * FROM users"}, "strict")'
224
- ],
225
- useCases: [
226
- 'Final validation before deployment',
227
- 'Understanding complex field dependencies',
228
- 'Getting suggestions for configuration improvements',
229
- 'Validating operation-specific requirements'
230
- ],
231
- performance: 'Moderate speed - performs comprehensive checks. 50-200ms depending on complexity.',
232
- bestPractices: [
233
- 'Use after validate_node_minimal passes',
234
- 'Apply suggested fixes from response',
235
- 'Use strict profile for production',
236
- 'Check warnings even if validation passes'
237
- ],
238
- pitfalls: [
239
- 'Slower than minimal validation',
240
- 'May be overkill for simple configurations',
241
- 'Strict profile might be too restrictive for development'
242
- ],
243
- relatedTools: ['validate_node_minimal', 'validate_workflow', 'get_property_dependencies']
244
- }
245
- },
246
- get_node_for_task: {
247
- name: 'get_node_for_task',
248
- category: 'templates',
249
- essentials: {
250
- description: 'Get pre-configured node settings for common tasks',
251
- keyParameters: ['task'],
252
- example: 'get_node_for_task("send_slack_message")',
253
- performance: 'Instant - returns pre-built configurations',
254
- tips: [
255
- 'Use list_tasks() to see all available tasks',
256
- 'Look for userMustProvide fields to complete'
257
- ]
258
- },
259
- full: {
260
- description: 'Returns pre-configured node settings for common automation tasks. Each template includes the correct node type, operation settings, and clear markers for what needs user input.',
261
- parameters: {
262
- task: { type: 'string', description: 'Task identifier (use list_tasks to see all)', required: true }
263
- },
264
- returns: 'Complete node configuration with parameters, position, and user guidance',
265
- examples: [
266
- 'get_node_for_task("send_slack_message") - Slack message template',
267
- 'get_node_for_task("receive_webhook") - Webhook trigger setup',
268
- 'get_node_for_task("query_database") - Database query template'
269
- ],
270
- useCases: [
271
- 'Quickly setting up common automation patterns',
272
- 'Learning correct node configurations',
273
- 'Avoiding configuration mistakes',
274
- 'Rapid workflow prototyping'
275
- ],
276
- performance: 'Instant - returns static templates. No computation required.',
277
- bestPractices: [
278
- 'Check userMustProvide fields for required inputs',
279
- 'Use list_tasks() to discover available templates',
280
- 'Validate with validate_node_minimal after filling in',
281
- 'Use as starting point, then customize'
282
- ],
283
- pitfalls: [
284
- 'Templates are generic - customize for specific needs',
285
- 'Not all tasks have templates',
286
- 'Some fields marked userMustProvide are critical'
287
- ],
288
- relatedTools: ['list_tasks', 'get_node_essentials', 'validate_node_minimal']
289
- }
290
- },
291
- n8n_create_workflow: {
292
- name: 'n8n_create_workflow',
293
- category: 'workflow_management',
294
- essentials: {
295
- description: 'Create a new workflow in n8n via API',
296
- keyParameters: ['name', 'nodes', 'connections'],
297
- example: 'n8n_create_workflow({name: "My Workflow", nodes: [...], connections: {...}})',
298
- performance: 'API call - depends on n8n instance',
299
- tips: [
300
- 'ALWAYS use node names in connections, never IDs',
301
- 'Error handling properties go at NODE level, not inside parameters!',
302
- 'Requires N8N_API_URL and N8N_API_KEY configuration'
303
- ]
304
- },
305
- full: {
306
- description: 'Creates a new workflow in your n8n instance via API. Requires proper API configuration. Returns the created workflow with assigned ID.\n\n⚠️ CRITICAL: Error handling properties (onError, retryOnFail, etc.) are NODE-LEVEL properties, not inside parameters!',
307
- parameters: {
308
- name: { type: 'string', description: 'Workflow name', required: true },
309
- nodes: { type: 'array', description: 'Array of node configurations', required: true },
310
- connections: { type: 'object', description: 'Node connections (use names!)', required: true },
311
- settings: { type: 'object', description: 'Workflow settings', required: false },
312
- tags: { type: 'array', description: 'Tag IDs (not names)', required: false }
313
- },
314
- returns: 'Created workflow object with id, name, nodes, connections, and metadata',
315
- examples: [
316
- `// Basic workflow with proper error handling
317
- n8n_create_workflow({
318
- name: "Slack Notification with Error Handling",
319
- nodes: [
320
- {
321
- id: "1",
322
- name: "Webhook",
323
- type: "n8n-nodes-base.webhook",
324
- typeVersion: 2,
325
- position: [250, 300],
326
- parameters: {
327
- path: "/webhook",
328
- method: "POST"
329
- },
330
- // ✅ CORRECT - Error handling at node level
331
- onError: "continueRegularOutput"
332
- },
333
- {
334
- id: "2",
335
- name: "Database Query",
336
- type: "n8n-nodes-base.postgres",
337
- typeVersion: 2.4,
338
- position: [450, 300],
339
- parameters: {
340
- operation: "executeQuery",
341
- query: "SELECT * FROM users"
342
- },
343
- // ✅ CORRECT - Error handling at node level
344
- onError: "continueErrorOutput",
345
- retryOnFail: true,
346
- maxTries: 3,
347
- waitBetweenTries: 2000
348
- },
349
- {
350
- id: "3",
351
- name: "Error Handler",
352
- type: "n8n-nodes-base.slack",
353
- typeVersion: 2.2,
354
- position: [650, 450],
355
- parameters: {
356
- resource: "message",
357
- operation: "post",
358
- channel: "#errors",
359
- text: "Database query failed!"
360
- }
361
- }
362
- ],
363
- connections: {
364
- "Webhook": {
365
- main: [[{node: "Database Query", type: "main", index: 0}]]
366
- },
367
- "Database Query": {
368
- main: [[{node: "Success Handler", type: "main", index: 0}]],
369
- error: [[{node: "Error Handler", type: "main", index: 0}]] // Error output
8
+ const tool_docs_1 = require("./tool-docs");
9
+ function getToolDocumentation(toolName, depth = 'essentials') {
10
+ if (toolName === 'javascript_code_node_guide') {
11
+ return getJavaScriptCodeNodeGuide(depth);
370
12
  }
371
- }
372
- })`
373
- ],
374
- useCases: [
375
- 'Deploying workflows programmatically',
376
- 'Automating workflow creation',
377
- 'Migrating workflows between instances',
378
- 'Creating workflows from templates',
379
- 'Building error-resilient workflows'
380
- ],
381
- performance: 'Depends on n8n instance and network. Typically 100-500ms.',
382
- bestPractices: [
383
- 'CRITICAL: Use node NAMES in connections, not IDs',
384
- 'CRITICAL: Place error handling at NODE level, not in parameters',
385
- 'Validate workflow before creating',
386
- 'Use meaningful workflow names',
387
- 'Add error handling to external service nodes',
388
- 'Check n8n_health_check before creating'
389
- ],
390
- pitfalls: [
391
- 'Placing error handling properties inside parameters object',
392
- 'Using node IDs in connections breaks UI display',
393
- 'Workflow not automatically activated',
394
- 'Tags must exist (use tag IDs not names)',
395
- 'API must be configured correctly'
396
- ],
397
- relatedTools: ['validate_workflow', 'n8n_update_partial_workflow', 'n8n_list_workflows']
398
- }
399
- },
400
- n8n_update_partial_workflow: {
401
- name: 'n8n_update_partial_workflow',
402
- category: 'workflow_management',
403
- essentials: {
404
- description: 'Update workflows using diff operations - only send changes, not entire workflow',
405
- keyParameters: ['id', 'operations'],
406
- example: 'n8n_update_partial_workflow({id: "123", operations: [{type: "updateNode", nodeName: "Slack", changes: {onError: "continueRegularOutput"}}]})',
407
- performance: '80-90% more efficient than full updates',
408
- tips: [
409
- 'Maximum 5 operations per request',
410
- 'Can reference nodes by name or ID',
411
- 'Error handling properties go at NODE level, not inside parameters!'
412
- ]
413
- },
414
- full: {
415
- description: 'Update existing workflows using diff operations. Much more efficient than full updates as it only sends the changes. Supports 13 different operation types.\n\n⚠️ CRITICAL: Error handling properties (onError, retryOnFail, maxTries, etc.) are NODE-LEVEL properties, not parameters!',
416
- parameters: {
417
- id: { type: 'string', description: 'Workflow ID to update', required: true },
418
- operations: { type: 'array', description: 'Array of diff operations (max 5)', required: true },
419
- validateOnly: { type: 'boolean', description: 'Only validate without applying', required: false }
420
- },
421
- returns: 'Updated workflow with applied changes and operation results',
422
- examples: [
423
- `// Update node parameters (properties inside parameters object)
424
- n8n_update_partial_workflow({
425
- id: "123",
426
- operations: [{
427
- type: "updateNode",
428
- nodeName: "Slack",
429
- changes: {
430
- "parameters.channel": "#general", // Nested property
431
- "parameters.text": "Hello world" // Nested property
13
+ if (toolName === 'python_code_node_guide') {
14
+ return getPythonCodeNodeGuide(depth);
432
15
  }
433
- }]
434
- })`,
435
- `// Update error handling (NODE-LEVEL properties, NOT inside parameters!)
436
- n8n_update_partial_workflow({
437
- id: "123",
438
- operations: [{
439
- type: "updateNode",
440
- nodeName: "HTTP Request",
441
- changes: {
442
- onError: "continueErrorOutput", // ✅ Correct - node level
443
- retryOnFail: true, // ✅ Correct - node level
444
- maxTries: 3, // ✅ Correct - node level
445
- waitBetweenTries: 2000 // ✅ Correct - node level
16
+ const tool = tool_docs_1.toolsDocumentation[toolName];
17
+ if (!tool) {
18
+ return `Tool '${toolName}' not found. Use tools_documentation() to see available tools.`;
446
19
  }
447
- }]
448
- })`,
449
- `// WRONG - Don't put error handling inside parameters!
450
- // ❌ BAD: changes: {"parameters.onError": "continueErrorOutput"}
451
- // ✅ GOOD: changes: {onError: "continueErrorOutput"}`,
452
- `// Add error connection between nodes
453
- n8n_update_partial_workflow({
454
- id: "123",
455
- operations: [{
456
- type: "addConnection",
457
- source: "Database Query",
458
- target: "Error Handler",
459
- sourceOutput: "error", // Error output
460
- targetInput: "main"
461
- }]
462
- })`
463
- ],
464
- useCases: [
465
- 'Updating node configurations',
466
- 'Adding error handling to nodes',
467
- 'Adding/removing connections',
468
- 'Enabling/disabling nodes',
469
- 'Moving nodes in canvas',
470
- 'Updating workflow metadata'
471
- ],
472
- performance: 'Very efficient - only sends changes. 80-90% less data than full updates.',
473
- bestPractices: [
474
- 'Error handling properties (onError, retryOnFail, etc.) go at NODE level, not in parameters',
475
- 'Use dot notation for nested properties: "parameters.url"',
476
- 'Batch related operations together',
477
- 'Use validateOnly:true to test first',
478
- 'Reference nodes by name for clarity'
479
- ],
480
- pitfalls: [
481
- 'Placing error handling properties inside parameters (common mistake!)',
482
- 'Maximum 5 operations per request',
483
- 'Some operations have dependencies',
484
- 'Node must exist for update operations',
485
- 'Connection nodes must both exist'
486
- ],
487
- relatedTools: ['n8n_get_workflow', 'n8n_update_full_workflow', 'validate_workflow']
488
- }
489
- },
490
- code_node_guide: {
491
- name: 'code_node_guide',
492
- category: 'code_node',
493
- essentials: {
494
- description: 'Comprehensive guide for writing Code node JavaScript and Python',
495
- keyParameters: ['topic'],
496
- example: 'tools_documentation({topic: "code_node_guide"})',
497
- performance: 'Instant - returns documentation',
498
- tips: [
499
- 'Essential reading before writing Code node scripts',
500
- 'Covers all built-in variables and helpers',
501
- 'Includes common patterns and error handling'
502
- ]
503
- },
504
- full: {
505
- description: `Complete reference for the n8n Code node, covering JavaScript and Python execution environments, built-in variables, helper functions, and best practices.
506
-
507
- ## Code Node Basics
508
-
509
- The Code node allows custom JavaScript or Python code execution within workflows. It runs in a sandboxed environment with access to n8n-specific variables and helpers.
510
-
511
- ### JavaScript Environment
512
- - **ES2022 support** with async/await
513
- - **Built-in libraries**:
514
- - **luxon** (DateTime) - Date/time manipulation
515
- - **jmespath** - JSON queries via $jmespath()
516
- - **crypto** - Available via require('crypto') despite editor warnings!
517
- - **Node.js globals**: Buffer, process.env (limited)
518
- - **require() IS available** for built-in modules only (crypto, util, etc.)
519
- - **No npm packages** - only Node.js built-ins and n8n-provided libraries
520
-
521
- ### Python Environment
522
- - **Python 3.10+** with standard library (Pyodide runtime)
523
- - **No pip install** - standard library only
524
- - **Variables use underscore prefix**: \`_input\`, \`_json\`, \`_jmespath\` (not \`$\`)
525
- - **item.json is JsProxy**: Use \`.to_py()\` to convert to Python dict
526
- - **Shared state** between Code nodes in same execution
527
-
528
- ## Essential Variables
529
-
530
- ### $input
531
- Access to all incoming data:
532
- \`\`\`javascript
533
- // Get all items from all inputs
534
- const allItems = $input.all(); // Returns: Item[][]
20
+ if (depth === 'essentials') {
21
+ const { essentials } = tool;
22
+ return `# ${tool.name}
535
23
 
536
- // Get items from specific input (0-indexed)
537
- const firstInput = $input.all(0); // Returns: Item[]
24
+ ${essentials.description}
538
25
 
539
- // Get first item from first input
540
- const firstItem = $input.first(); // Returns: Item
26
+ **Example**: ${essentials.example}
541
27
 
542
- // Get last item from first input
543
- const lastItem = $input.last(); // Returns: Item
28
+ **Key parameters**: ${essentials.keyParameters.join(', ')}
544
29
 
545
- // Get specific item by index
546
- const item = $input.item(2); // Returns: Item at index 2
547
- \`\`\`
30
+ **Performance**: ${essentials.performance}
548
31
 
549
- ### items
550
- Direct access to incoming items (legacy, prefer $input):
551
- \`\`\`javascript
552
- // items is equivalent to $input.all()[0]
553
- for (const item of items) {
554
- console.log(item.json); // Access JSON data
555
- console.log(item.binary); // Access binary data
556
- }
557
- \`\`\`
32
+ **Tips**:
33
+ ${essentials.tips.map(tip => `- ${tip}`).join('\n')}
558
34
 
559
- ### $json
560
- Shortcut to current item's JSON data (only in "Run Once for Each Item" mode):
561
- \`\`\`javascript
562
- // These are equivalent in single-item mode:
563
- const value1 = $json.fieldName;
564
- const value2 = items[0].json.fieldName;
565
- \`\`\`
35
+ For full documentation, use: tools_documentation({topic: "${toolName}", depth: "full"})`;
36
+ }
37
+ const { full } = tool;
38
+ return `# ${tool.name}
566
39
 
567
- ### Accessing Other Nodes
568
- Access data from other nodes using $('Node Name') syntax:
569
- \`\`\`javascript
570
- // Access another node's output - use $('Node Name') NOT $node
571
- const prevData = $('Previous Node').all();
572
- const firstItem = $('Previous Node').first();
573
- const specificItem = $('Previous Node').item(0);
40
+ ${full.description}
574
41
 
575
- // Get node parameter
576
- const webhookUrl = $('Webhook').params.path;
42
+ ## Parameters
43
+ ${Object.entries(full.parameters).map(([param, info]) => `- **${param}** (${info.type}${info.required ? ', required' : ''}): ${info.description}`).join('\n')}
577
44
 
578
- // Python uses underscore prefix
579
- const pythonData = _('Previous Node').all();
580
- \`\`\`
45
+ ## Returns
46
+ ${full.returns}
581
47
 
582
- ⚠️ **Expression vs Code Node Syntax**:
583
- - **Expressions**: \`{{$node['Previous Node'].json.field}}\`
584
- - **Code Node**: \`$('Previous Node').first().json.field\`
585
- - These are NOT interchangeable!
48
+ ## Examples
49
+ ${full.examples.map(ex => `\`\`\`javascript\n${ex}\n\`\`\``).join('\n\n')}
586
50
 
587
- ### $workflow
588
- Workflow metadata:
589
- \`\`\`javascript
590
- const workflowId = $workflow.id;
591
- const workflowName = $workflow.name;
592
- const isActive = $workflow.active;
593
- \`\`\`
51
+ ## Common Use Cases
52
+ ${full.useCases.map(uc => `- ${uc}`).join('\n')}
594
53
 
595
- ### $execution
596
- Execution context:
597
- \`\`\`javascript
598
- const executionId = $execution.id;
599
- const executionMode = $execution.mode; // 'manual', 'trigger', etc.
600
- const resumeUrl = $execution.resumeUrl; // For wait nodes
601
- \`\`\`
54
+ ## Performance
55
+ ${full.performance}
602
56
 
603
- ### $prevNode
604
- Access to the immediate previous node:
605
- \`\`\`javascript
606
- const prevOutput = $prevNode.outputIndex; // Which output triggered this
607
- const prevData = $prevNode.data; // Previous node's data
608
- const prevName = $prevNode.name; // Previous node's name
609
- \`\`\`
57
+ ## Best Practices
58
+ ${full.bestPractices.map(bp => `- ${bp}`).join('\n')}
610
59
 
611
- ## Helper Functions
60
+ ## Common Pitfalls
61
+ ${full.pitfalls.map(p => `- ${p}`).join('\n')}
612
62
 
613
- ### Date/Time (Luxon)
614
- \`\`\`javascript
615
- // Current time
616
- const now = DateTime.now();
617
- const iso = now.toISO();
63
+ ## Related Tools
64
+ ${full.relatedTools.map(t => `- ${t}`).join('\n')}`;
65
+ }
66
+ function getToolsOverview(depth = 'essentials') {
67
+ const packageJson = require('../../package.json');
68
+ const supportedN8nVersion = packageJson.dependencies?.n8n?.replace(/[^0-9.]/g, '') || 'latest';
69
+ if (depth === 'essentials') {
70
+ return `# n8n MCP Tools Reference
618
71
 
619
- // Parse dates
620
- const date = DateTime.fromISO('2024-01-01');
621
- const formatted = date.toFormat('yyyy-MM-dd');
72
+ ## Important: Compatibility Notice
73
+ ⚠️ This MCP server is tested with n8n version ${supportedN8nVersion}.
74
+ Inform the user to check their n8n version matches or is compatible with the supported version listed above.
622
75
 
623
- // Time math
624
- const tomorrow = now.plus({ days: 1 });
625
- const hourAgo = now.minus({ hours: 1 });
626
- \`\`\`
76
+ ## Code Node Configuration
77
+ When working with Code nodes, always start by calling the relevant guide:
78
+ - tools_documentation({topic: "javascript_code_node_guide"}) for JavaScript Code nodes
79
+ - tools_documentation({topic: "python_code_node_guide"}) for Python Code nodes
627
80
 
628
- ### JSON Queries (JMESPath)
629
- \`\`\`javascript
630
- // n8n uses $jmespath() - NOTE: parameter order is reversed from standard JMESPath!
631
- const data = { users: [{ name: 'John', age: 30 }, { name: 'Jane', age: 25 }] };
632
- const names = $jmespath(data, 'users[*].name'); // ['John', 'Jane']
81
+ ## Standard Workflow Pattern
633
82
 
634
- // ⚠️ IMPORTANT: Numeric literals in filters need BACKTICKS in n8n!
635
- const adults = $jmespath(data, 'users[?age >= \`18\`]'); // ✅ CORRECT - backticks around 18
636
- const seniors = $jmespath(data, 'users[?age >= \`65\`]'); // CORRECT
83
+ 1. **Find** the node you need:
84
+ - search_nodes({query: "slack"}) - Search by keyword
85
+ - list_nodes({category: "communication"}) - List by category
86
+ - list_ai_tools() - List AI-capable nodes
637
87
 
638
- // WRONG - This will cause a syntax error!
639
- // const adults = $jmespath(data, 'users[?age >= 18]'); // Missing backticks
88
+ 2. **Configure** the node:
89
+ - get_node_essentials("nodes-base.slack") - Get essential properties only (5KB)
90
+ - get_node_info("nodes-base.slack") - Get complete schema (100KB+)
91
+ - search_node_properties("nodes-base.slack", "auth") - Find specific properties
640
92
 
641
- // More filter examples with proper backticks:
642
- const expensive = $jmespath(items, '[?price > \`100\`]');
643
- const inStock = $jmespath(products, '[?quantity >= \`1\`]');
644
- const highPriority = $jmespath(tasks, '[?priority == \`1\`]');
93
+ 3. **Validate** before deployment:
94
+ - validate_node_minimal("nodes-base.slack", config) - Check required fields
95
+ - validate_node_operation("nodes-base.slack", config) - Full validation with fixes
96
+ - validate_workflow(workflow) - Validate entire workflow
645
97
 
646
- // String comparisons don't need backticks
647
- const activeUsers = $jmespath(data, 'users[?status == "active"]');
98
+ ## Tool Categories
648
99
 
649
- // Python uses underscore prefix
650
- const pythonAdults = _jmespath(data, 'users[?age >= \`18\`]');
651
- \`\`\`
100
+ **Discovery Tools**
101
+ - search_nodes - Full-text search across all nodes
102
+ - list_nodes - List nodes with filtering by category, package, or type
103
+ - list_ai_tools - List all AI-capable nodes with usage guidance
104
+
105
+ **Configuration Tools**
106
+ - get_node_essentials - Returns 10-20 key properties with examples
107
+ - get_node_info - Returns complete node schema with all properties
108
+ - search_node_properties - Search for specific properties within a node
109
+ - get_property_dependencies - Analyze property visibility dependencies
110
+
111
+ **Validation Tools**
112
+ - validate_node_minimal - Quick validation of required fields only
113
+ - validate_node_operation - Full validation with operation awareness
114
+ - validate_workflow - Complete workflow validation including connections
115
+
116
+ **Template Tools**
117
+ - list_tasks - List common task templates
118
+ - get_node_for_task - Get pre-configured node for specific tasks
119
+ - search_templates - Search workflow templates by keyword
120
+ - get_template - Get complete workflow JSON by ID
121
+
122
+ **n8n API Tools** (requires N8N_API_URL configuration)
123
+ - n8n_create_workflow - Create new workflows
124
+ - n8n_update_partial_workflow - Update workflows using diff operations
125
+ - n8n_validate_workflow - Validate workflow from n8n instance
126
+ - n8n_trigger_webhook_workflow - Trigger workflow execution
127
+
128
+ ## Performance Characteristics
129
+ - Instant (<10ms): search_nodes, list_nodes, get_node_essentials
130
+ - Fast (<100ms): validate_node_minimal, get_node_for_task
131
+ - Moderate (100-500ms): validate_workflow, get_node_info
132
+ - Network-dependent: All n8n_* tools
133
+
134
+ For comprehensive documentation on any tool:
135
+ tools_documentation({topic: "tool_name", depth: "full"})`;
136
+ }
137
+ const categories = getAllCategories();
138
+ return `# n8n MCP Tools - Complete Reference
139
+
140
+ ## Important: Compatibility Notice
141
+ ⚠️ This MCP server is tested with n8n version ${supportedN8nVersion}.
142
+ Run n8n_health_check() to verify your n8n instance compatibility and API connectivity.
143
+
144
+ ## Code Node Guides
145
+ For Code node configuration, use these comprehensive guides:
146
+ - tools_documentation({topic: "javascript_code_node_guide", depth: "full"}) - JavaScript patterns, n8n variables, error handling
147
+ - tools_documentation({topic: "python_code_node_guide", depth: "full"}) - Python patterns, data access, debugging
148
+
149
+ ## All Available Tools by Category
150
+
151
+ ${categories.map(cat => {
152
+ const tools = getToolsByCategory(cat);
153
+ const categoryName = cat.charAt(0).toUpperCase() + cat.slice(1).replace('_', ' ');
154
+ return `### ${categoryName}
155
+ ${tools.map(toolName => {
156
+ const tool = tool_docs_1.toolsDocumentation[toolName];
157
+ return `- **${toolName}**: ${tool.essentials.description}`;
158
+ }).join('\n')}`;
159
+ }).join('\n\n')}
160
+
161
+ ## Usage Notes
162
+ - All node types require the "nodes-base." or "nodes-langchain." prefix
163
+ - Use get_node_essentials() first for most tasks (95% smaller than get_node_info)
164
+ - Validation profiles: minimal (editing), runtime (default), strict (deployment)
165
+ - n8n API tools only available when N8N_API_URL and N8N_API_KEY are configured
166
+
167
+ For detailed documentation on any tool:
168
+ tools_documentation({topic: "tool_name", depth: "full"})`;
169
+ }
170
+ function searchToolDocumentation(keyword) {
171
+ const results = [];
172
+ for (const [toolName, tool] of Object.entries(tool_docs_1.toolsDocumentation)) {
173
+ const searchText = `${toolName} ${tool.essentials.description} ${tool.full.description}`.toLowerCase();
174
+ if (searchText.includes(keyword.toLowerCase())) {
175
+ results.push(toolName);
176
+ }
177
+ }
178
+ return results;
179
+ }
180
+ function getToolsByCategory(category) {
181
+ return Object.entries(tool_docs_1.toolsDocumentation)
182
+ .filter(([_, tool]) => tool.category === category)
183
+ .map(([name, _]) => name);
184
+ }
185
+ function getAllCategories() {
186
+ const categories = new Set();
187
+ Object.values(tool_docs_1.toolsDocumentation).forEach(tool => {
188
+ categories.add(tool.category);
189
+ });
190
+ return Array.from(categories);
191
+ }
192
+ function getJavaScriptCodeNodeGuide(depth = 'essentials') {
193
+ if (depth === 'essentials') {
194
+ return `# JavaScript Code Node Guide
652
195
 
653
- ⚠️ **CRITICAL DIFFERENCES** from standard JMESPath:
654
- 1. **Parameter order is REVERSED**:
655
- - **Expression**: \`{{$jmespath("query", data)}}\`
656
- - **Code Node**: \`$jmespath(data, "query")\`
657
- 2. **Numeric literals in filters MUST use backticks**: \`[?age >= \`18\`]\`
658
- - This is n8n-specific and differs from standard JMESPath documentation!
196
+ Essential patterns for JavaScript in n8n Code nodes.
659
197
 
660
- ### Available Functions and Libraries
198
+ **Key Concepts**:
199
+ - Access all items: \`$input.all()\` (not items[0])
200
+ - Current item data: \`$json\`
201
+ - Return format: \`[{json: {...}}]\` (array of objects)
661
202
 
662
- #### Built-in Node.js Modules (via require)
203
+ **Available Helpers**:
204
+ - \`$helpers.httpRequest()\` - Make HTTP requests
205
+ - \`$jmespath()\` - Query JSON data
206
+ - \`DateTime\` - Luxon for date handling
207
+
208
+ **Common Patterns**:
663
209
  \`\`\`javascript
664
- // These modules ARE available via require():
665
- const crypto = require('crypto'); // Cryptographic functions
666
- const util = require('util'); // Utility functions
667
- const querystring = require('querystring'); // URL query string utilities
668
-
669
- // Example: Generate secure random token
670
- const crypto = require('crypto');
671
- const token = crypto.randomBytes(32).toString('hex');
672
- const uuid = crypto.randomUUID();
210
+ // Process all items
211
+ const allItems = $input.all();
212
+ return allItems.map(item => ({
213
+ json: {
214
+ processed: true,
215
+ original: item.json,
216
+ timestamp: DateTime.now().toISO()
217
+ }
218
+ }));
673
219
  \`\`\`
674
220
 
675
- **Note**: The editor may show errors for require() but it WORKS at runtime!
221
+ **Tips**:
222
+ - Webhook data is under \`.body\` property
223
+ - Use async/await for HTTP requests
224
+ - Always return array format
676
225
 
677
- #### Standalone Functions (Global Scope)
226
+ For full guide: tools_documentation({topic: "javascript_code_node_guide", depth: "full"})`;
227
+ }
228
+ return `# JavaScript Code Node Complete Guide
229
+
230
+ Comprehensive guide for using JavaScript in n8n Code nodes.
231
+
232
+ ## Data Access Patterns
233
+
234
+ ### Accessing Input Data
678
235
  \`\`\`javascript
679
- // Workflow static data - persists between executions
680
- // IMPORTANT: These are standalone functions, NOT methods on $helpers!
681
- const staticData = $getWorkflowStaticData('global'); // Global static data
682
- const nodeData = $getWorkflowStaticData('node'); // Node-specific data
236
+ // Get all items from previous node
237
+ const allItems = $input.all();
683
238
 
684
- // Example: Counter that persists
685
- const staticData = $getWorkflowStaticData('global');
686
- staticData.counter = (staticData.counter || 0) + 1;
239
+ // Get specific node's output
240
+ const webhookData = $node["Webhook"].json;
687
241
 
688
- // WRONG - This will cause "$helpers is not defined" error:
689
- // const data = $helpers.getWorkflowStaticData('global');
242
+ // Current item in loop
243
+ const currentItem = $json;
690
244
 
691
- // JMESPath queries - note the parameter order!
692
- const result = $jmespath(data, 'users[*].name');
245
+ // First item only
246
+ const firstItem = $input.first().json;
693
247
  \`\`\`
694
248
 
695
- #### $helpers Object (When Available)
249
+ ### Webhook Data Structure
250
+ **CRITICAL**: Webhook data is nested under \`.body\`:
696
251
  \`\`\`javascript
697
- // Some n8n versions provide $helpers with these methods:
698
- // (Always test availability in your n8n instance)
252
+ // WRONG - Won't work
253
+ const data = $json.name;
254
+
255
+ // CORRECT - Webhook data is under body
256
+ const data = $json.body.name;
257
+ \`\`\`
258
+
259
+ ## Available Built-in Functions
699
260
 
700
- // HTTP requests
261
+ ### HTTP Requests
262
+ \`\`\`javascript
263
+ // Make HTTP request
701
264
  const response = await $helpers.httpRequest({
702
265
  method: 'GET',
703
266
  url: 'https://api.example.com/data',
704
- headers: { 'Authorization': 'Bearer token' }
267
+ headers: {
268
+ 'Authorization': 'Bearer token'
269
+ }
705
270
  });
706
-
707
- // Binary data preparation
708
- const binaryData = await $helpers.prepareBinaryData(
709
- Buffer.from('content'),
710
- 'file.txt',
711
- 'text/plain'
712
- );
713
-
714
- // Check if $helpers exists before using:
715
- if (typeof $helpers !== 'undefined' && $helpers.httpRequest) {
716
- // Use $helpers.httpRequest
717
- } else {
718
- throw new Error('HTTP requests not available in this n8n version');
719
- }
720
271
  \`\`\`
721
272
 
722
- #### Important Notes:
723
- - **$getWorkflowStaticData()** is ALWAYS a standalone function
724
- - **require()** works for built-in Node.js modules despite editor warnings
725
- - **$helpers** availability varies by n8n version - always check first
726
- - Python uses underscore prefix: \`_getWorkflowStaticData()\`, \`_jmespath()\`
727
- - Editor red underlines are often false positives - test at runtime!
273
+ ### Date/Time Handling
274
+ \`\`\`javascript
275
+ // Using Luxon DateTime
276
+ const now = DateTime.now();
277
+ const formatted = now.toFormat('yyyy-MM-dd');
278
+ const iso = now.toISO();
279
+ const plus5Days = now.plus({ days: 5 });
280
+ \`\`\`
728
281
 
729
- ## Return Format
282
+ ### JSON Querying
283
+ \`\`\`javascript
284
+ // JMESPath queries
285
+ const result = $jmespath($json, "users[?age > 30].name");
286
+ \`\`\`
730
287
 
731
- Code nodes MUST return an array of objects with 'json' property:
288
+ ## Return Format Requirements
732
289
 
290
+ ### Correct Format
733
291
  \`\`\`javascript
734
- // CORRECT - Array of objects with json property
735
- return [
736
- { json: { id: 1, name: 'Item 1' } },
737
- { json: { id: 2, name: 'Item 2' } }
738
- ];
292
+ // MUST return array of objects with json property
293
+ return [{
294
+ json: {
295
+ result: "success",
296
+ data: processedData
297
+ }
298
+ }];
739
299
 
740
- // CORRECT - Single item (still wrapped in array)
741
- return [{ json: { result: 'success' } }];
300
+ // Multiple items
301
+ return items.map(item => ({
302
+ json: {
303
+ id: item.id,
304
+ processed: true
305
+ }
306
+ }));
307
+ \`\`\`
742
308
 
743
- // CORRECT - With binary data
309
+ ### Binary Data
310
+ \`\`\`javascript
311
+ // Return with binary data
744
312
  return [{
745
- json: { filename: 'report.pdf' },
313
+ json: { filename: "report.pdf" },
746
314
  binary: {
747
- data: {
748
- data: base64String,
749
- mimeType: 'application/pdf',
750
- fileName: 'report.pdf'
751
- }
315
+ data: Buffer.from(pdfContent).toString('base64')
752
316
  }
753
317
  }];
754
-
755
- // ❌ WRONG - Not an array
756
- return { json: { result: 'success' } };
757
-
758
- // ❌ WRONG - No json property
759
- return [{ result: 'success' }];
760
-
761
- // ❌ WRONG - Not wrapped in object
762
- return ['item1', 'item2'];
763
318
  \`\`\`
764
319
 
765
320
  ## Common Patterns
766
321
 
767
- ### Data Transformation
322
+ ### Processing Webhook Data
768
323
  \`\`\`javascript
769
- // Transform all items
770
- const transformedItems = [];
771
- for (const item of items) {
772
- transformedItems.push({
773
- json: {
774
- ...item.json,
775
- processed: true,
776
- timestamp: DateTime.now().toISO(),
777
- uppercaseName: item.json.name?.toUpperCase()
778
- }
779
- });
780
- }
781
- return transformedItems;
782
- \`\`\`
324
+ // Extract webhook payload
325
+ const webhookBody = $json.body;
326
+ const { username, email, items } = webhookBody;
783
327
 
784
- ### Filtering Items
785
- \`\`\`javascript
786
- // Filter items based on condition
787
- return items
788
- .filter(item => item.json.status === 'active')
789
- .map(item => ({ json: item.json }));
328
+ // Process and return
329
+ return [{
330
+ json: {
331
+ username,
332
+ email,
333
+ itemCount: items.length,
334
+ processedAt: DateTime.now().toISO()
335
+ }
336
+ }];
790
337
  \`\`\`
791
338
 
792
- ### Aggregation
339
+ ### Aggregating Data
793
340
  \`\`\`javascript
794
- // Aggregate data from all items
795
- const total = items.reduce((sum, item) => sum + (item.json.amount || 0), 0);
796
- const average = total / items.length;
341
+ // Sum values across all items
342
+ const allItems = $input.all();
343
+ const total = allItems.reduce((sum, item) => {
344
+ return sum + (item.json.amount || 0);
345
+ }, 0);
797
346
 
798
347
  return [{
799
- json: {
348
+ json: {
800
349
  total,
801
- average,
802
- count: items.length,
803
- items: items.map(i => i.json)
350
+ itemCount: allItems.length,
351
+ average: total / allItems.length
804
352
  }
805
353
  }];
806
354
  \`\`\`
807
355
 
808
356
  ### Error Handling
809
357
  \`\`\`javascript
810
- // Safe data access with defaults
811
- const results = [];
812
- for (const item of items) {
813
- try {
814
- const value = item.json?.nested?.field || 'default';
815
- results.push({
816
- json: {
817
- processed: value,
818
- status: 'success'
819
- }
820
- });
821
- } catch (error) {
822
- results.push({
823
- json: {
824
- error: error.message,
825
- status: 'failed',
826
- originalItem: item.json
827
- }
828
- });
829
- }
830
- }
831
- return results;
832
- \`\`\`
833
-
834
- ### Working with APIs
835
- \`\`\`javascript
836
- // Make HTTP request and process response
837
358
  try {
838
359
  const response = await $helpers.httpRequest({
839
- method: 'POST',
840
- url: 'https://api.example.com/process',
841
- body: {
842
- data: items.map(item => item.json)
843
- },
844
- headers: {
845
- 'Content-Type': 'application/json'
846
- }
360
+ url: 'https://api.example.com/data'
847
361
  });
848
362
 
849
- return [{ json: response }];
363
+ return [{
364
+ json: {
365
+ success: true,
366
+ data: response
367
+ }
368
+ }];
850
369
  } catch (error) {
851
- throw new Error(\`API request failed: \${error.message}\`);
852
- }
853
- \`\`\`
854
-
855
- ### Async Operations
856
- \`\`\`javascript
857
- // Process items with async operations
858
- const results = [];
859
- for (const item of items) {
860
- // Simulate async operation
861
- await new Promise(resolve => setTimeout(resolve, 100));
862
-
863
- results.push({
370
+ return [{
864
371
  json: {
865
- ...item.json,
866
- processedAt: new Date().toISOString()
372
+ success: false,
373
+ error: error.message
867
374
  }
868
- });
375
+ }];
869
376
  }
870
- return results;
871
377
  \`\`\`
872
378
 
873
- ### Webhook Data Access (CRITICAL!)
874
- \`\`\`javascript
875
- // ⚠️ WEBHOOK DATA IS NESTED UNDER 'body' PROPERTY!
876
- // This is a common source of errors in webhook-triggered workflows
877
-
878
- // ❌ WRONG - This will be undefined for webhook data:
879
- const command = items[0].json.testCommand;
379
+ ## Available Node.js Modules
380
+ - crypto (built-in)
381
+ - Buffer
382
+ - URL/URLSearchParams
383
+ - Basic Node.js globals
880
384
 
881
- // CORRECT - Webhook data is wrapped in 'body':
882
- const command = items[0].json.body.testCommand;
385
+ ## Common Pitfalls
386
+ 1. Using \`items[0]\` instead of \`$input.all()\`
387
+ 2. Forgetting webhook data is under \`.body\`
388
+ 3. Returning plain objects instead of \`[{json: {...}}]\`
389
+ 4. Using \`require()\` for external modules (not allowed)
390
+ 5. Trying to use expression syntax \`{{}}\` inside code
883
391
 
884
- // Complete webhook data processing example:
885
- const webhookData = items[0].json.body; // Get the actual webhook payload
886
- const headers = items[0].json.headers; // HTTP headers are separate
887
- const query = items[0].json.query; // Query parameters are separate
392
+ ## Best Practices
393
+ 1. Always validate input data exists before accessing
394
+ 2. Use try-catch for HTTP requests
395
+ 3. Return early on validation failures
396
+ 4. Keep code simple and readable
397
+ 5. Use descriptive variable names
888
398
 
889
- // Process webhook payload
890
- return [{
891
- json: {
892
- command: webhookData.testCommand,
893
- user: webhookData.user,
894
- timestamp: DateTime.now().toISO(),
895
- requestId: headers['x-request-id'],
896
- source: query.source || 'unknown'
897
- }
898
- }];
399
+ ## Related Tools
400
+ - get_node_essentials("nodes-base.code")
401
+ - validate_node_operation()
402
+ - python_code_node_guide (for Python syntax)`;
403
+ }
404
+ function getPythonCodeNodeGuide(depth = 'essentials') {
405
+ if (depth === 'essentials') {
406
+ return `# Python Code Node Guide
899
407
 
900
- // For other trigger nodes (non-webhook), data is directly under json:
901
- // - Schedule Trigger: items[0].json contains timestamp
902
- // - Database Trigger: items[0].json contains row data
903
- // - File Trigger: items[0].json contains file info
904
- \`\`\`
408
+ Essential patterns for Python in n8n Code nodes.
905
409
 
906
- ## Python Code Examples
410
+ **Key Concepts**:
411
+ - Access all items: \`_input.all()\` (not items[0])
412
+ - Current item data: \`_json\`
413
+ - Return format: \`[{"json": {...}}]\` (list of dicts)
907
414
 
908
- ### Basic Python Structure
909
- \`\`\`python
910
- import json
911
- from datetime import datetime
912
-
913
- # Access items - Python uses underscore prefix for built-in variables
914
- results = []
915
- for item in _input.all():
916
- # IMPORTANT: item.json is NOT a standard Python dict!
917
- # Use to_py() to convert to a proper Python dict
918
- processed_item = item.json.to_py() # Converts JsProxy to Python dict
919
- processed_item['timestamp'] = datetime.now().isoformat()
920
- results.append({'json': processed_item})
921
-
922
- return results
923
- \`\`\`
415
+ **Limitations**:
416
+ - No external libraries (no requests, pandas, numpy)
417
+ - Use built-in functions only
418
+ - No pip install available
924
419
 
925
- ### Python Data Processing
420
+ **Common Patterns**:
926
421
  \`\`\`python
927
- # Aggregate data - use _input.all() to get items
928
- items = _input.all()
929
- total = sum(item.json.get('amount', 0) for item in items)
930
- average = total / len(items) if items else 0
931
-
932
- # For safe dict operations, convert JsProxy to Python dict
933
- safe_items = []
934
- for item in items:
935
- # Convert JsProxy to dict to avoid KeyError with null values
936
- safe_dict = item.json.to_py()
937
- safe_items.append(safe_dict)
938
-
939
- # Return aggregated result
422
+ # Process all items
423
+ all_items = _input.all()
940
424
  return [{
941
- 'json': {
942
- 'total': total,
943
- 'average': average,
944
- 'count': len(items),
945
- 'processed_at': datetime.now().isoformat(),
946
- 'items': safe_items # Now these are proper Python dicts
425
+ "json": {
426
+ "processed": True,
427
+ "count": len(all_items),
428
+ "first_item": all_items[0]["json"] if all_items else None
947
429
  }
948
430
  }]
949
431
  \`\`\`
950
432
 
951
- ## Code Node as AI Tool
433
+ **Tips**:
434
+ - Webhook data is under ["body"] key
435
+ - Use json module for parsing
436
+ - datetime for date handling
952
437
 
953
- Code nodes can be used as custom tools for AI agents:
438
+ For full guide: tools_documentation({topic: "python_code_node_guide", depth: "full"})`;
439
+ }
440
+ return `# Python Code Node Complete Guide
954
441
 
955
- \`\`\`javascript
956
- // Code node configured as AI tool
957
- // Name: "Calculate Discount"
958
- // Description: "Calculates discount based on quantity"
442
+ Comprehensive guide for using Python in n8n Code nodes.
443
+
444
+ ## Data Access Patterns
959
445
 
960
- const quantity = $json.quantity || 1;
961
- const basePrice = $json.price || 0;
446
+ ### Accessing Input Data
447
+ \`\`\`python
448
+ # Get all items from previous node
449
+ all_items = _input.all()
962
450
 
963
- let discount = 0;
964
- if (quantity >= 100) discount = 0.20;
965
- else if (quantity >= 50) discount = 0.15;
966
- else if (quantity >= 20) discount = 0.10;
967
- else if (quantity >= 10) discount = 0.05;
451
+ # Get specific node's output (use _node)
452
+ webhook_data = _node["Webhook"]["json"]
968
453
 
969
- const discountAmount = basePrice * quantity * discount;
970
- const finalPrice = (basePrice * quantity) - discountAmount;
454
+ # Current item in loop
455
+ current_item = _json
971
456
 
972
- return [{
973
- json: {
974
- quantity,
975
- basePrice,
976
- discountPercentage: discount * 100,
977
- discountAmount,
978
- finalPrice,
979
- savings: discountAmount
980
- }
981
- }];
457
+ # First item only
458
+ first_item = _input.first()["json"]
982
459
  \`\`\`
983
460
 
984
- ## Security Considerations
461
+ ### Webhook Data Structure
462
+ **CRITICAL**: Webhook data is nested under ["body"]:
463
+ \`\`\`python
464
+ # WRONG - Won't work
465
+ data = _json["name"]
985
466
 
986
- ### Available Security Features
987
- \`\`\`javascript
988
- // ✅ Crypto IS available despite editor warnings!
989
- const crypto = require('crypto');
990
-
991
- // Generate secure random values
992
- const randomBytes = crypto.randomBytes(32);
993
- const randomUUID = crypto.randomUUID();
994
-
995
- // Create hashes
996
- const hash = crypto.createHash('sha256')
997
- .update('data to hash')
998
- .digest('hex');
999
-
1000
- // HMAC for signatures
1001
- const hmac = crypto.createHmac('sha256', 'secret-key')
1002
- .update('data to sign')
1003
- .digest('hex');
467
+ # CORRECT - Webhook data is under body
468
+ data = _json["body"]["name"]
1004
469
  \`\`\`
1005
470
 
1006
- ### Banned Operations
1007
- - No file system access (fs module) - except read-only for some paths
1008
- - No network requests except via $helpers.httpRequest
1009
- - No child process execution
1010
- - No external npm packages (only built-in Node.js modules)
1011
- - No eval() or Function() constructor
471
+ ## Available Built-in Modules
1012
472
 
1013
- ### Safe Practices
1014
- \`\`\`javascript
1015
- // ✅ SAFE - Use crypto for secure operations
1016
- const crypto = require('crypto');
1017
- const token = crypto.randomBytes(32).toString('hex');
473
+ ### Standard Library Only
474
+ \`\`\`python
475
+ import json
476
+ import datetime
477
+ import base64
478
+ import hashlib
479
+ import urllib.parse
480
+ import re
481
+ import math
482
+ import random
483
+ \`\`\`
1018
484
 
1019
- // SAFE - Use built-in JSON parsing
1020
- const parsed = JSON.parse(jsonString);
485
+ ### Date/Time Handling
486
+ \`\`\`python
487
+ from datetime import datetime, timedelta
1021
488
 
1022
- // UNSAFE - Never use eval
1023
- const parsed = eval('(' + jsonString + ')');
489
+ # Current time
490
+ now = datetime.now()
491
+ iso_format = now.isoformat()
1024
492
 
1025
- // SAFE - Validate input
1026
- if (typeof item.json.userId !== 'string') {
1027
- throw new Error('userId must be a string');
1028
- }
493
+ # Date arithmetic
494
+ future = now + timedelta(days=5)
495
+ formatted = now.strftime("%Y-%m-%d")
496
+ \`\`\`
1029
497
 
1030
- // SAFE - Sanitize for logs
1031
- const safeLog = String(userInput).substring(0, 100);
498
+ ### JSON Operations
499
+ \`\`\`python
500
+ # Parse JSON string
501
+ data = json.loads(json_string)
1032
502
 
1033
- // SAFE - Time-safe comparison for secrets
1034
- const expectedToken = 'abc123';
1035
- const providedToken = item.json.token;
1036
- const tokensMatch = crypto.timingSafeEqual(
1037
- Buffer.from(expectedToken),
1038
- Buffer.from(providedToken || '')
1039
- );
503
+ # Convert to JSON
504
+ json_output = json.dumps({"key": "value"})
1040
505
  \`\`\`
1041
506
 
1042
- ## Debugging Tips
507
+ ## Return Format Requirements
1043
508
 
1044
- ### Console Output
1045
- \`\`\`javascript
1046
- // Console.log appears in n8n execution logs
1047
- console.log('Processing item:', item.json.id);
1048
- console.error('Error details:', error);
1049
-
1050
- // Return debug info in development
509
+ ### Correct Format
510
+ \`\`\`python
511
+ # MUST return list of dictionaries with "json" key
1051
512
  return [{
1052
- json: {
1053
- result: processedData,
1054
- debug: {
1055
- itemCount: items.length,
1056
- executionId: $execution.id,
1057
- timestamp: new Date().toISOString()
513
+ "json": {
514
+ "result": "success",
515
+ "data": processed_data
1058
516
  }
1059
- }
1060
- }];
1061
- \`\`\`
1062
-
1063
- ### Error Messages
1064
- \`\`\`javascript
1065
- // Provide helpful error context
1066
- if (!item.json.requiredField) {
1067
- throw new Error(\`Missing required field 'requiredField' in item \${items.indexOf(item)}\`);
1068
- }
517
+ }]
1069
518
 
1070
- // Include original data in errors
1071
- try {
1072
- // processing...
1073
- } catch (error) {
1074
- throw new Error(\`Failed to process item \${item.json.id}: \${error.message}\`);
1075
- }
519
+ # Multiple items
520
+ return [
521
+ {"json": {"id": item["json"]["id"], "processed": True}}
522
+ for item in all_items
523
+ ]
1076
524
  \`\`\`
1077
525
 
1078
- ## Performance Best Practices
1079
-
1080
- 1. **Avoid nested loops** when possible
1081
- 2. **Use array methods** (map, filter, reduce) for clarity
1082
- 3. **Limit HTTP requests** - batch when possible
1083
- 4. **Return early** for error conditions
1084
- 5. **Keep state minimal** - Code nodes are stateless between executions
1085
-
1086
- ## Common Mistakes to Avoid
1087
-
1088
- 1. **Forgetting to return an array**
1089
- 2. **Not wrapping in json property**
1090
- 3. **Modifying items array directly**
1091
- 4. **Using undefined variables**
1092
- 5. **Infinite loops with while statements**
1093
- 6. **Not handling missing data gracefully**
1094
- 7. **Forgetting await for async operations**`,
1095
- parameters: {
1096
- topic: { type: 'string', description: 'Specific Code node topic (optional)', required: false }
1097
- },
1098
- returns: 'Comprehensive Code node documentation and examples',
1099
- examples: [
1100
- 'tools_documentation({topic: "code_node_guide"}) - Full guide',
1101
- 'tools_documentation({topic: "code_node_guide", depth: "full"}) - Complete reference'
1102
- ],
1103
- useCases: [
1104
- 'Learning Code node capabilities',
1105
- 'Understanding built-in variables',
1106
- 'Finding the right helper function',
1107
- 'Debugging Code node issues',
1108
- 'Building custom AI tools'
1109
- ],
1110
- performance: 'Instant - returns static documentation',
1111
- bestPractices: [
1112
- 'Read before writing Code nodes',
1113
- 'Reference for variable names',
1114
- 'Copy examples as starting points',
1115
- 'Check security considerations'
1116
- ],
1117
- pitfalls: [
1118
- 'Not all Node.js features available',
1119
- 'Python has limited libraries',
1120
- 'State not preserved between executions'
1121
- ],
1122
- relatedTools: ['get_node_essentials', 'validate_node_operation', 'get_node_for_task']
1123
- }
1124
- }
1125
- };
1126
- function getToolDocumentation(toolName, depth = 'essentials') {
1127
- const tool = exports.toolsDocumentation[toolName];
1128
- if (!tool) {
1129
- return `Tool '${toolName}' not found. Use tools_documentation() to see available tools.`;
1130
- }
1131
- if (depth === 'essentials') {
1132
- const { essentials } = tool;
1133
- return `# ${tool.name}
526
+ ### Binary Data
527
+ \`\`\`python
528
+ # Return with binary data
529
+ import base64
1134
530
 
1135
- ${essentials.description}
531
+ return [{
532
+ "json": {"filename": "report.pdf"},
533
+ "binary": {
534
+ "data": base64.b64encode(pdf_content).decode()
535
+ }
536
+ }]
537
+ \`\`\`
1136
538
 
1137
- **Example**: ${essentials.example}
539
+ ## Common Patterns
1138
540
 
1139
- **Key parameters**: ${essentials.keyParameters.join(', ')}
541
+ ### Processing Webhook Data
542
+ \`\`\`python
543
+ # Extract webhook payload
544
+ webhook_body = _json["body"]
545
+ username = webhook_body.get("username")
546
+ email = webhook_body.get("email")
547
+ items = webhook_body.get("items", [])
1140
548
 
1141
- **Performance**: ${essentials.performance}
549
+ # Process and return
550
+ return [{
551
+ "json": {
552
+ "username": username,
553
+ "email": email,
554
+ "item_count": len(items),
555
+ "processed_at": datetime.now().isoformat()
556
+ }
557
+ }]
558
+ \`\`\`
1142
559
 
1143
- **Tips**:
1144
- ${essentials.tips.map(tip => `- ${tip}`).join('\n')}
560
+ ### Aggregating Data
561
+ \`\`\`python
562
+ # Sum values across all items
563
+ all_items = _input.all()
564
+ total = sum(item["json"].get("amount", 0) for item in all_items)
1145
565
 
1146
- For full documentation, use: tools_documentation({topic: "${toolName}", depth: "full"})`;
566
+ return [{
567
+ "json": {
568
+ "total": total,
569
+ "item_count": len(all_items),
570
+ "average": total / len(all_items) if all_items else 0
1147
571
  }
1148
- const { full } = tool;
1149
- return `# ${tool.name}
572
+ }]
573
+ \`\`\`
1150
574
 
1151
- ${full.description}
575
+ ### Error Handling
576
+ \`\`\`python
577
+ try:
578
+ # Process data
579
+ webhook_data = _json["body"]
580
+ result = process_data(webhook_data)
581
+
582
+ return [{
583
+ "json": {
584
+ "success": True,
585
+ "data": result
586
+ }
587
+ }]
588
+ except Exception as e:
589
+ return [{
590
+ "json": {
591
+ "success": False,
592
+ "error": str(e)
593
+ }
594
+ }]
595
+ \`\`\`
1152
596
 
1153
- ## Parameters
1154
- ${Object.entries(full.parameters).map(([param, info]) => `- **${param}** (${info.type}${info.required ? ', required' : ''}): ${info.description}`).join('\n')}
597
+ ### Data Transformation
598
+ \`\`\`python
599
+ # Transform all items
600
+ all_items = _input.all()
601
+ transformed = []
602
+
603
+ for item in all_items:
604
+ data = item["json"]
605
+ transformed.append({
606
+ "json": {
607
+ "id": data.get("id"),
608
+ "name": data.get("name", "").upper(),
609
+ "timestamp": datetime.now().isoformat(),
610
+ "valid": bool(data.get("email"))
611
+ }
612
+ })
1155
613
 
1156
- ## Returns
1157
- ${full.returns}
614
+ return transformed
615
+ \`\`\`
1158
616
 
1159
- ## Examples
1160
- ${full.examples.map(ex => `\`\`\`javascript\n${ex}\n\`\`\``).join('\n\n')}
617
+ ## Limitations & Workarounds
1161
618
 
1162
- ## Common Use Cases
1163
- ${full.useCases.map(uc => `- ${uc}`).join('\n')}
619
+ ### No External Libraries
620
+ \`\`\`python
621
+ # CANNOT USE:
622
+ # import requests # Not available
623
+ # import pandas # Not available
624
+ # import numpy # Not available
1164
625
 
1165
- ## Performance
1166
- ${full.performance}
626
+ # WORKAROUND: Use JavaScript Code node for HTTP requests
627
+ # Or use HTTP Request node before Code node
628
+ \`\`\`
1167
629
 
1168
- ## Best Practices
1169
- ${full.bestPractices.map(bp => `- ${bp}`).join('\n')}
630
+ ### HTTP Requests Alternative
631
+ Since Python requests library is not available, use:
632
+ 1. JavaScript Code node with $helpers.httpRequest()
633
+ 2. HTTP Request node before your Python Code node
634
+ 3. Webhook node to receive data
1170
635
 
1171
636
  ## Common Pitfalls
1172
- ${full.pitfalls.map(p => `- ${p}`).join('\n')}
1173
-
1174
- ## Related Tools
1175
- ${full.relatedTools.map(t => `- ${t}`).join('\n')}`;
1176
- }
1177
- function getToolsOverview(depth = 'essentials') {
1178
- if (depth === 'essentials') {
1179
- return `# n8n MCP Tools Quick Reference
1180
-
1181
- Welcome! Here's how to efficiently work with n8n nodes:
1182
-
1183
- ## Essential Workflow
1184
- 1. **Find**: search_nodes({query: "slack"})
1185
- 2. **Configure**: get_node_essentials("n8n-nodes-base.slack")
1186
- 3. **Validate**: validate_node_minimal() → validate_node_operation()
1187
- 4. **Deploy**: n8n_create_workflow() (if API configured)
1188
-
1189
- ## Key Tips
1190
- - Always use get_node_essentials instead of get_node_info (95% smaller!)
1191
- - Use node NAMES in connections, never IDs
1192
- - Try get_node_for_task() for common patterns
1193
- - Call validate_node_minimal() for quick checks
1194
-
1195
- ## Get Help
1196
- - tools_documentation({topic: "search_nodes"}) - Get help for specific tool
1197
- - tools_documentation({topic: "code_node_guide"}) - Essential Code node reference
1198
- - tools_documentation({topic: "overview", depth: "full"}) - See complete guide
1199
- - list_tasks() - See available task templates
1200
-
1201
- Available tools: ${Object.keys(exports.toolsDocumentation).join(', ')}`;
1202
- }
1203
- return `# n8n MCP Tools Complete Guide
637
+ 1. Trying to import external libraries (requests, pandas)
638
+ 2. Using items[0] instead of _input.all()
639
+ 3. Forgetting webhook data is under ["body"]
640
+ 4. Returning dictionaries instead of [{"json": {...}}]
641
+ 5. Not handling missing keys with .get()
1204
642
 
1205
- ## Overview
1206
- The n8n MCP provides 39 tools to help you discover, configure, validate, and deploy n8n workflows. Tools are organized into categories for easy discovery.
1207
-
1208
- ## Tool Categories
1209
-
1210
- ### Discovery Tools
1211
- - **search_nodes**: Find nodes by keyword (uses OR logic)
1212
- - **list_nodes**: Browse nodes by category, package, or type
1213
- - **list_ai_tools**: See all AI-capable nodes (263 available)
1214
-
1215
- ### Configuration Tools
1216
- - **get_node_essentials**: Get key properties only (<5KB vs 100KB+)
1217
- - **get_node_info**: Get complete node details (use sparingly)
1218
- - **search_node_properties**: Find specific properties in large nodes
1219
- - **get_property_dependencies**: Understand field relationships
1220
-
1221
- ### Validation Tools
1222
- - **validate_node_minimal**: Quick required field check
1223
- - **validate_node_operation**: Full operation-aware validation
1224
- - **validate_workflow**: Complete workflow validation
1225
- - **validate_workflow_connections**: Check node connections
1226
- - **validate_workflow_expressions**: Validate n8n expressions
1227
-
1228
- ### Task & Template Tools
1229
- - **list_tasks**: See available task templates
1230
- - **get_node_for_task**: Get pre-configured nodes
1231
- - **list_node_templates**: Find workflow templates
1232
- - **search_templates**: Search template library
1233
-
1234
- ### Workflow Management (requires API config)
1235
- - **n8n_create_workflow**: Create new workflows
1236
- - **n8n_update_partial_workflow**: Efficient diff-based updates
1237
- - **n8n_update_full_workflow**: Replace entire workflow
1238
- - **n8n_list_workflows**: List workflows with filtering
1239
-
1240
- ## Recommended Patterns
1241
-
1242
- ### Building a Simple Workflow
1243
- \`\`\`javascript
1244
- // 1. Find what you need
1245
- search_nodes({query: "webhook"})
1246
- search_nodes({query: "slack"})
1247
-
1248
- // 2. Get configurations
1249
- get_node_essentials("n8n-nodes-base.webhook")
1250
- get_node_essentials("n8n-nodes-base.slack")
1251
-
1252
- // 3. Build and validate
1253
- const workflow = {
1254
- name: "My Webhook to Slack",
1255
- nodes: [...],
1256
- connections: {"Webhook": {main: [[{node: "Slack", type: "main", index: 0}]]}}
1257
- };
1258
- validate_workflow(workflow)
1259
-
1260
- // 4. Deploy (if API configured)
1261
- n8n_create_workflow(workflow)
1262
- \`\`\`
1263
-
1264
- ### Working with Code Nodes
1265
- The Code node is essential for custom logic. Always reference the guide:
1266
- \`\`\`javascript
1267
- // Get comprehensive Code node documentation
1268
- tools_documentation({topic: "code_node_guide"})
1269
-
1270
- // Common Code node pattern
1271
- get_node_essentials("n8n-nodes-base.code")
1272
- // Returns minimal config with JavaScript/Python examples
1273
-
1274
- // Validate Code node configuration
1275
- validate_node_operation("n8n-nodes-base.code", {
1276
- language: "javaScript",
1277
- jsCode: "return items.map(item => ({json: {...item.json, processed: true}}))"
1278
- })
1279
- \`\`\`
1280
-
1281
- ### Node-Level Properties Reference
1282
- ⚠️ **CRITICAL**: These properties go at the NODE level, not inside parameters!
643
+ ## Best Practices
644
+ 1. Always use .get() for dictionary access
645
+ 2. Validate data before processing
646
+ 3. Handle empty input arrays
647
+ 4. Use list comprehensions for transformations
648
+ 5. Return meaningful error messages
1283
649
 
1284
- \`\`\`javascript
1285
- {
1286
- // Required properties
1287
- "id": "unique_id",
1288
- "name": "Node Name",
1289
- "type": "n8n-nodes-base.postgres",
1290
- "typeVersion": 2.6,
1291
- "position": [450, 300],
1292
- "parameters": { /* operation-specific params */ },
1293
-
1294
- // Optional properties (all at node level!)
1295
- "credentials": {
1296
- "postgres": {
1297
- "id": "cred-id",
1298
- "name": "My Postgres"
1299
- }
1300
- },
1301
- "disabled": false, // Disable node execution
1302
- "notes": "Internal note", // Node documentation
1303
- "notesInFlow": true, // Show notes on canvas
1304
- "executeOnce": true, // Execute only once per run
1305
-
1306
- // Error handling (at node level!)
1307
- "onError": "continueErrorOutput", // or "continueRegularOutput", "stopWorkflow"
1308
- "retryOnFail": true,
1309
- "maxTries": 3,
1310
- "waitBetweenTries": 2000,
1311
- "alwaysOutputData": true,
1312
-
1313
- // Deprecated (use onError instead)
1314
- "continueOnFail": false
1315
- }
1316
- \`\`\`
650
+ ## Type Conversions
651
+ \`\`\`python
652
+ # String to number
653
+ value = float(_json.get("amount", "0"))
1317
654
 
1318
- **Common properties explained:**
1319
- - **credentials**: Links to credential sets (use credential ID and name)
1320
- - **disabled**: Node won't execute when true
1321
- - **notes**: Internal documentation for the node
1322
- - **notesInFlow**: Display notes on workflow canvas
1323
- - **executeOnce**: Execute node only once even with multiple input items
1324
- - **onError**: Modern error handling - what to do on failure
1325
- - **retryOnFail**: Automatically retry failed executions
1326
- - **maxTries**: Number of retry attempts (with retryOnFail)
1327
- - **waitBetweenTries**: Milliseconds between retries
1328
- - **alwaysOutputData**: Output data even on error (for debugging)
1329
-
1330
- ### Using AI Tools
1331
- Any node can be an AI tool! Connect it to an AI Agent's ai_tool port:
1332
- \`\`\`javascript
1333
- get_node_as_tool_info("n8n-nodes-base.slack")
1334
- // Returns how to configure Slack as an AI tool
1335
- \`\`\`
655
+ # Boolean conversion
656
+ is_active = str(_json.get("active", "")).lower() == "true"
1336
657
 
1337
- ### Efficient Updates
1338
- Use partial updates to save 80-90% bandwidth:
1339
- \`\`\`javascript
1340
- n8n_update_partial_workflow({
1341
- id: "workflow-id",
1342
- operations: [
1343
- {type: "updateNode", nodeId: "Slack", updates: {parameters: {channel: "general"}}}
1344
- ]
1345
- })
658
+ # Safe JSON parsing
659
+ try:
660
+ data = json.loads(_json.get("json_string", "{}"))
661
+ except json.JSONDecodeError:
662
+ data = {}
1346
663
  \`\`\`
1347
664
 
1348
- ## Performance Guide
1349
- - **Fastest**: get_node_essentials, validate_node_minimal, list_tasks
1350
- - **Fast**: search_nodes, list_nodes, get_node_for_task
1351
- - **Moderate**: validate_node_operation, n8n_update_partial_workflow
1352
- - **Slow**: get_node_info (100KB+), validate_workflow (full analysis)
1353
-
1354
- ## Common Pitfalls to Avoid
1355
- 1. Using get_node_info when get_node_essentials would work
1356
- 2. Using node IDs instead of names in connections
1357
- 3. Not validating before creating workflows
1358
- 4. Searching with long phrases instead of keywords
1359
- 5. Forgetting to configure N8N_API_URL for management tools
1360
-
1361
- ## Getting More Help
1362
- - Use tools_documentation({topic: "toolname"}) for any tool
1363
- - Check CLAUDE.md for latest updates and examples
1364
- - Run n8n_health_check() to verify API connectivity`;
1365
- }
1366
- function searchToolDocumentation(query) {
1367
- const results = [];
1368
- const searchTerms = query.toLowerCase().split(' ');
1369
- for (const [toolName, tool] of Object.entries(exports.toolsDocumentation)) {
1370
- const searchText = `${toolName} ${tool.essentials.description} ${tool.category}`.toLowerCase();
1371
- if (searchTerms.some(term => searchText.includes(term))) {
1372
- results.push(toolName);
1373
- }
1374
- }
1375
- return results;
1376
- }
1377
- function getToolsByCategory(category) {
1378
- return Object.entries(exports.toolsDocumentation)
1379
- .filter(([_, tool]) => tool.category === category)
1380
- .map(([name, _]) => name);
1381
- }
1382
- function getAllCategories() {
1383
- const categories = new Set();
1384
- Object.values(exports.toolsDocumentation).forEach(tool => {
1385
- categories.add(tool.category);
1386
- });
1387
- return Array.from(categories);
665
+ ## Related Tools
666
+ - get_node_essentials("nodes-base.code")
667
+ - validate_node_operation()
668
+ - javascript_code_node_guide (for JavaScript syntax)`;
1388
669
  }
1389
670
  //# sourceMappingURL=tools-documentation.js.map