Skip to main content
Glama

list_code

Display extracted code nodes from n8n workflows to review and organize automation components for efficient development.

Instructions

List all extracted code nodes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the 'list_code' tool including its description and input schema (no required inputs). Part of the getToolDefinitions() array export.
    {
      name: 'list_code',
      description: 'List all extracted code nodes',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • The switch case in ToolHandler.handleTool() that executes the 'list_code' tool by creating a NodeManager instance and calling its listNodes() method.
    case 'list_code':
      const codeListManager = new NodeManager(this.workflowsPath);
      await codeListManager.initialize();
      return await codeListManager.listNodes();
  • The core implementation in NodeManager.listNodes() that loads metadata from .metadata.json, groups extracted nodes by type (code, prompt, sql, etc.), formats a detailed list output grouped by type with icons and file paths, and returns it in MCP content format.
    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.'
        }]
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('List') but doesn't mention whether this is a read-only operation, if it requires authentication, what the output format might be, or any rate limits. This leaves significant gaps for a tool that likely interacts with code data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence ('List all extracted code nodes') that directly states the purpose without unnecessary words. It's appropriately sized for a simple tool, though it could be slightly more informative given the lack of other context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of listing code nodes (which may involve data retrieval and formatting), no annotations, and no output schema, the description is incomplete. It doesn't explain what 'extracted code nodes' are, how they're structured, or what the return values look like, leaving the agent with insufficient information for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description doesn't add parameter details beyond the schema, but since there are no parameters, this is acceptable, aligning with the baseline for zero parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List all extracted code nodes' clearly states the verb ('List') and resource ('extracted code nodes'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'list' or 'extract_code', leaving ambiguity about its specific role in the toolset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'list' or 'extract_code'. The description implies usage for listing code nodes but doesn't specify prerequisites, context, or exclusions, leaving the agent to infer usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mckinleymedia/mcflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server