list_code
Display all extracted code nodes from n8n workflows to support development, automation, and project organization.
Instructions
List all extracted code nodes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/nodes/manager.ts:565-633 (handler)Core implementation of list_code tool: lists all extracted nodes from metadata file, groups by type (code, prompt, sql, template, json), formats nicely with icons and paths.async listNodes(): Promise<any> { const metadata = await this.loadMetadata(); let output = 'π Extracted Nodes Library\n\n'; // Group by type const byType: Record<NodeType, any[]> = { code: [], prompt: [], sql: [], template: [], json: [] }; for (const [workflowName, nodes] of Object.entries(metadata)) { for (const node of nodes as any[]) { byType[node.nodeType as NodeType].push({ ...node, workflowName }); } } // Display by type if (byType.code.length > 0) { output += 'π Code Nodes\n'; for (const node of byType.code) { const icon = node.subType === 'python' ? 'π' : 'β'; output += ` ${icon} ${node.nodeName} (${node.workflowName})\n`; output += ` π ${node.filePath}\n`; } output += '\n'; } if (byType.prompt.length > 0) { output += 'π¬ Prompt Nodes\n'; for (const node of byType.prompt) { const icon = node.subType === 'openai' ? 'π€' : 'π§ '; output += ` ${icon} ${node.nodeName} (${node.workflowName})\n`; output += ` π ${node.filePath}\n`; } output += '\n'; } if (byType.sql.length > 0) { output += 'ποΈ SQL Nodes\n'; for (const node of byType.sql) { output += ` π ${node.nodeName} (${node.workflowName})\n`; output += ` π ${node.filePath}\n`; } output += '\n'; } if (byType.template.length > 0) { output += 'π Template Nodes\n'; for (const node of byType.template) { const icon = node.subType === 'html' ? 'π' : 'π'; output += ` ${icon} ${node.nodeName} (${node.workflowName})\n`; output += ` π ${node.filePath}\n`; } output += '\n'; } return { content: [{ type: 'text', text: output || 'π No nodes extracted yet.\n\nUse "McFlow extract-nodes" to extract nodes from workflows.' }] }; }
- src/tools/registry.ts:361-368 (registration)Tool registration: defines name 'list_code', description, and empty input schema (no parameters required).{ name: 'list_code', description: 'List all extracted code nodes', inputSchema: { type: 'object', properties: {}, }, },
- src/tools/handler.ts:224-227 (handler)Dispatch handler in ToolHandler.handleTool: instantiates NodeManager and calls its listNodes() method to execute the tool.case 'list_code': const codeListManager = new NodeManager(this.workflowsPath); await codeListManager.initialize(); return await codeListManager.listNodes();