Skip to main content
Glama

search_nodes

Locate nodes in the MemoryMesh knowledge graph by matching names, types, and metadata content against a specific search query for efficient data retrieval.

Instructions

Search for nodes in the knowledge graph based on a query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query to match against node names, types, and metadata content

Implementation Reference

  • Handler logic that executes the search_nodes MCP tool by invoking the knowledge graph manager's searchNodes method and formatting the tool response.
    case "search_nodes":
        const searchResults = await this.knowledgeGraphManager.searchNodes(args.query);
        return formatToolResponse({
            data: searchResults,
            actionTaken: `Searched nodes with query: ${args.query}`
        });
  • Schema definition and tool metadata (name, description, inputSchema) for the search_nodes tool.
        name: "search_nodes",
        description: "Search for nodes in the knowledge graph based on a query",
        inputSchema: {
            type: "object",
            properties: {
                query: {
                    type: "string",
                    description: "The search query to match against node names, types, and metadata content"
                },
            },
            required: ["query"],
        },
    },
  • Routes calls to the search_nodes tool to the appropriate SearchToolHandler instance.
    if (toolName.match(/^(read_graph|search_nodes|open_nodes)$/)) {
        return this.searchHandler;
  • Exports the searchTools array which includes the search_nodes tool definition for static tool registration.
    export const searchTools: Tool[] = [
        {
            name: "read_graph",
            description: "Read the entire knowledge graph",
            inputSchema: {
                type: "object",
                properties: {},
            },
        },
    
        {
            name: "search_nodes",
            description: "Search for nodes in the knowledge graph based on a query",
            inputSchema: {
                type: "object",
                properties: {
                    query: {
                        type: "string",
                        description: "The search query to match against node names, types, and metadata content"
                    },
                },
                required: ["query"],
            },
        },
    
        {
            name: "open_nodes",
            description: "Open specific nodes in the knowledge graph by their names",
            inputSchema: {
                type: "object",
                properties: {
                    names: {
                        type: "array",
                        items: {type: "string", description: "Node name to open"},
                        description: "An array of node names to retrieve",
                    },
                },
                required: ["names"],
            },
        }
    ];

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/CheMiguel23/MemoryMesh'

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