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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query to match against node names, types, and metadata content |
Input Schema (JSON Schema)
{
"properties": {
"query": {
"description": "The search query to match against node names, types, and metadata content",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
}
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"], }, },
- src/integration/tools/handlers/ToolHandlerFactory.ts:46-47 (registration)Routes calls to the search_nodes tool to the appropriate SearchToolHandler instance.if (toolName.match(/^(read_graph|search_nodes|open_nodes)$/)) { return this.searchHandler;
- src/integration/tools/registry/staticTools.ts:177-217 (registration)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"], }, } ];