Skip to main content
Glama

search_nodes

Read-onlyIdempotent

Search n8n workflow nodes by keyword to find automation components, with optional real-world configuration examples for implementation guidance.

Instructions

Search n8n nodes by keyword with optional real-world examples. Pass query as string. Example: query="webhook" or query="database". Returns max 20 results. Use includeExamples=true to get top 2 template configs per node.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch terms. Use quotes for exact phrase.
limitNoMax results (default 20)
modeNoOR=any word, AND=all words, FUZZY=typo-tolerantOR
includeExamplesNoInclude top 2 real-world configuration examples from popular templates (default: false)

Implementation Reference

  • Tool schema definition including input schema, description, parameters, and requirements for the 'search_nodes' tool
      name: 'search_nodes',
      description: `Search n8n nodes by keyword with optional real-world examples. Pass query as string. Example: query="webhook" or query="database". Returns max 20 results. Use includeExamples=true to get top 2 template configs per node.`,
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search terms. Use quotes for exact phrase.',
          },
          limit: {
            type: 'number',
            description: 'Max results (default 20)',
            default: 20,
          },
          mode: {
            type: 'string',
            enum: ['OR', 'AND', 'FUZZY'],
            description: 'OR=any word, AND=all words, FUZZY=typo-tolerant',
            default: 'OR',
          },
          includeExamples: {
            type: 'boolean',
            description: 'Include top 2 real-world configuration examples from popular templates (default: false)',
            default: false,
          },
        },
        required: ['query'],
      },
    },
  • Main handler function for search_nodes tool, delegates to NodeRepository.searchNodes with defaults
    async searchNodes(args: any) {
      return this.repository.searchNodes(args.query, args.mode || 'OR', args.limit || 20);
    }
  • Core search implementation using SQLite LIKE queries for different modes (OR, AND, FUZZY). FTS5 used in production MCP server.
    searchNodes(query: string, mode: 'OR' | 'AND' | 'FUZZY' = 'OR', limit: number = 20): any[] {
      let sql = '';
      const params: any[] = [];
    
      if (mode === 'FUZZY') {
        // Simple fuzzy search
        sql = `
          SELECT * FROM nodes 
          WHERE node_type LIKE ? OR display_name LIKE ? OR description LIKE ?
          ORDER BY display_name
          LIMIT ?
        `;
        const fuzzyQuery = `%${query}%`;
        params.push(fuzzyQuery, fuzzyQuery, fuzzyQuery, limit);
      } else {
        // OR/AND mode
        const words = query.split(/\s+/).filter(w => w.length > 0);
        const conditions = words.map(() => 
          '(node_type LIKE ? OR display_name LIKE ? OR description LIKE ?)'
        );
        const operator = mode === 'AND' ? ' AND ' : ' OR ';
        
        sql = `
          SELECT * FROM nodes 
          WHERE ${conditions.join(operator)}
          ORDER BY display_name
          LIMIT ?
        `;
        
        for (const word of words) {
          const searchTerm = `%${word}%`;
          params.push(searchTerm, searchTerm, searchTerm);
        }
        params.push(limit);
      }
      
      const rows = this.db.prepare(sql).all(...params) as any[];
      return rows.map(row => this.parseNodeRow(row));
    }
  • Detailed tool documentation and schema used for tools_documentation tool responses.
    export const searchNodesDoc: ToolDocumentation = {
      name: 'search_nodes',
      category: 'discovery',
      essentials: {
        description: 'Text search across node names and descriptions. Returns most relevant nodes first, with frequently-used nodes (HTTP Request, Webhook, Set, Code, Slack) prioritized in results. Searches all 500+ nodes in the database.',
        keyParameters: ['query', 'mode', 'limit'],
        example: 'search_nodes({query: "webhook"})',
        performance: '<20ms even for complex queries',
        tips: [
          'OR mode (default): Matches any search word',
          'AND mode: Requires all words present',
          'FUZZY mode: Handles typos and spelling errors',
          'Use quotes for exact phrases: "google sheets"'
        ]
      },
      full: {
        description: 'Full-text search engine for n8n nodes using SQLite FTS5. Searches across node names, descriptions, and aliases. Results are ranked by relevance with commonly-used nodes given priority. Common nodes include: HTTP Request, Webhook, Set, Code, IF, Switch, Merge, SplitInBatches, Slack, Google Sheets.',
        parameters: {
          query: { type: 'string', description: 'Search keywords. Use quotes for exact phrases like "google sheets"', required: true },
          limit: { type: 'number', description: 'Maximum results to return. Default: 20, Max: 100', required: false },
          mode: { type: 'string', description: 'Search mode: "OR" (any word matches, default), "AND" (all words required), "FUZZY" (typo-tolerant)', required: false }
        },
        returns: 'Array of node objects sorted by relevance score. Each object contains: nodeType, displayName, description, category, relevance score. Common nodes appear first when relevance is similar.',
        examples: [
          'search_nodes({query: "webhook"}) - Returns Webhook node as top result',
          'search_nodes({query: "database"}) - Returns MySQL, Postgres, MongoDB, Redis, etc.',
          'search_nodes({query: "google sheets", mode: "AND"}) - Requires both words',
          'search_nodes({query: "slak", mode: "FUZZY"}) - Finds Slack despite typo',
          'search_nodes({query: "http api"}) - Finds HTTP Request, GraphQL, REST nodes',
          'search_nodes({query: "transform data"}) - Finds Set, Code, Function, Item Lists nodes'
        ],
        useCases: [
          'Finding nodes when you know partial names',
          'Discovering nodes by functionality (e.g., "email", "database", "transform")',
          'Handling user typos in node names',
          'Finding all nodes related to a service (e.g., "google", "aws", "microsoft")'
        ],
        performance: '<20ms for simple queries, <50ms for complex FUZZY searches. Uses FTS5 index for speed',
        bestPractices: [
          'Start with single keywords for broadest results',
          'Use FUZZY mode when users might misspell node names',
          'AND mode works best for 2-3 word searches',
          'Combine with get_node after finding the right node'
        ],
        pitfalls: [
          'AND mode searches all fields (name, description) not just node names',
          'FUZZY mode with very short queries (1-2 chars) may return unexpected results',
          'Exact matches in quotes are case-sensitive'
        ],
        relatedTools: ['get_node to configure found nodes', 'search_templates to find workflow examples', 'validate_node to check configurations']
      }
    };
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, indicating safe, repeatable operations. The description adds valuable behavioral context beyond this: it specifies the return limit ('Returns max 20 results'), explains the includeExamples parameter's effect ('to get top 2 template configs per node'), and provides query examples. This enhances understanding without contradicting annotations.

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

Conciseness5/5

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

The description is efficiently structured in two sentences: the first states the purpose and key parameters, the second explains the includeExamples feature. Every sentence adds value, with no wasted words, and it's front-loaded with essential information.

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

Completeness4/5

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

For a search tool with rich annotations (readOnlyHint, idempotentHint) and full schema coverage, the description is mostly complete. It explains the tool's behavior and key usage, though it lacks output details (no output schema provided) and doesn't fully differentiate from all siblings. Given the context, it's sufficient but could be slightly enhanced.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds minimal value: it mentions the query parameter ('Pass query as string') and includeExamples ('Use includeExamples=true to get top 2 template configs per node'), but doesn't provide additional semantics beyond what's in the schema. Baseline 3 is appropriate given high schema coverage.

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

Purpose5/5

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

The description clearly states the tool's purpose: 'Search n8n nodes by keyword with optional real-world examples.' It specifies the verb ('search'), resource ('n8n nodes'), and scope ('by keyword'), distinguishing it from sibling tools like get_node (retrieves a specific node) or search_templates (searches templates instead of nodes).

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

Usage Guidelines4/5

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

The description provides clear context on when to use this tool: for searching nodes by keyword, with examples like query='webhook' or query='database'. It distinguishes from get_node (which retrieves a specific node) by implying this is for broader searches. However, it doesn't explicitly state when NOT to use it or name alternatives like search_templates for template searches.

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/czlonkowski/n8n-mcp'

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