Skip to main content
Glama

search_nodes

Find saved knowledge nodes using text search, semantic matching, and filters for tags or status.

Instructions

Search saved nodes with full-text and semantic search

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateYes

Implementation Reference

  • The handler function for the 'search_nodes' MCP tool. It invokes the API client's searchNodes method with the input state, processes the response, and returns MCP-formatted content or an error.
    async ({ state }) => {
      const result = await apiClient.searchNodes(state);
    
      if (result.error) {
        return {
          content: [{ type: 'text', text: result.error }],
          isError: true,
        };
      }
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result.data, null, 2),
          },
        ],
      };
    },
  • Zod schema defining the input parameters for the 'search_nodes' tool: query (required string), optional tags array, status enum, and limit number.
    {
      state: z.object({
        query: z
          .string()
          .describe('Search term (matches title, body, or tags)'),
        tags: z
          .array(z.string())
          .optional()
          .describe('Filter by specific tags'),
        status: z
          .enum(['active', 'parked', 'done', 'archived'])
          .optional()
          .describe('Filter by status'),
        limit: z
          .number()
          .optional()
          .default(20)
          .describe('Maximum number of results'),
      }),
    },
  • src/nodes.ts:12-54 (registration)
    Registers the 'search_nodes' tool on the MCP server using server.tool(), providing name, description, input schema, and handler function.
    server.tool(
      'search_nodes',
      'Search saved nodes with full-text and semantic search',
      {
        state: z.object({
          query: z
            .string()
            .describe('Search term (matches title, body, or tags)'),
          tags: z
            .array(z.string())
            .optional()
            .describe('Filter by specific tags'),
          status: z
            .enum(['active', 'parked', 'done', 'archived'])
            .optional()
            .describe('Filter by status'),
          limit: z
            .number()
            .optional()
            .default(20)
            .describe('Maximum number of results'),
        }),
      },
      async ({ state }) => {
        const result = await apiClient.searchNodes(state);
    
        if (result.error) {
          return {
            content: [{ type: 'text', text: result.error }],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result.data, null, 2),
            },
          ],
        };
      },
    );
  • Helper method in the API client that sends a POST request to the '/mcp/search-nodes' backend endpoint with search parameters.
    async searchNodes(params: {
      query: string;
      tags?: string[];
      status?: string;
      limit?: number;
    }): Promise<ApiResponse<any>> {
      return this.request('/mcp/search-nodes', {
        method: 'POST',
        body: JSON.stringify(params),
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'full-text and semantic search' which gives some context about search methodology, but doesn't describe what 'saved nodes' are, how results are returned, whether there's pagination, authentication requirements, rate limits, or error conditions. For a search tool with no annotation coverage, this leaves significant behavioral gaps.

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 extremely concise at just 7 words, front-loading the core functionality without any wasted words. Every element ('search', 'saved nodes', 'full-text and semantic search') contributes directly to understanding the tool's purpose. The structure is optimal for quick comprehension.

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?

For a search tool with 4 nested parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what constitutes a 'saved node', how search results are structured, what 'semantic search' entails operationally, or any limitations of the search functionality. The combination of complex parameters and lack of structured metadata requires more descriptive context than provided.

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?

The description provides no parameter information beyond the tool name's implication of searching. With 0% schema description coverage, the description doesn't compensate by explaining what parameters are available or their purposes. However, the schema itself is well-structured with clear property descriptions for query, tags, status, and limit, establishing a baseline understanding despite the description's lack of parameter details.

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

Purpose4/5

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

The description clearly states the action ('search') and resource ('saved nodes'), specifying both full-text and semantic search capabilities. It distinguishes this from sibling tools like 'complete_node' or 'get_due_items' by focusing on search functionality rather than modification or retrieval of specific items. However, it doesn't explicitly differentiate from potential search alternatives within 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. The description doesn't mention any prerequisites, context for use, or comparisons with other tools. While sibling tools like 'quick_capture' or 'snooze_node' serve different purposes, there's no explicit direction on when search is appropriate versus those operations.

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/code-atlantic/Resurgo-MCP'

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