search_nodes
Search for knowledge graph entities in remote memory storage using query terms to find relevant nodes for data analysis and collaboration.
Instructions
엔티티를 검색합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- src/index.ts:546-560 (handler)Handler function for the 'search_nodes' tool. It calls memoryManager.searchNodes with the query argument and returns a JSON-formatted response containing the search results.private async handleSearchNodes(args: any) { const results = this.memoryManager.searchNodes(args.query); return { content: [{ type: 'text', text: JSON.stringify({ success: true, query: args.query, results: results, count: results.length, }, null, 2), }], }; }
- src/memory-graph.ts:122-139 (helper)Core implementation of the node search logic. Searches through all entities matching the query in name, entityType, or observations (case-insensitive substring match).searchNodes(query: string): Entity[] { const searchTerm = query.toLowerCase(); const results: Entity[] = []; this.graph.entities.forEach(entity => { const nameMatch = entity.name.toLowerCase().includes(searchTerm); const typeMatch = entity.entityType.toLowerCase().includes(searchTerm); const obsMatch = entity.observations.some(obs => obs.toLowerCase().includes(searchTerm) ); if (nameMatch || typeMatch || obsMatch) { results.push(entity); } }); return results; }
- src/index.ts:214-224 (registration)Registration of the 'search_nodes' tool in the listTools response, including name, description, and input schema.{ name: 'search_nodes', description: '엔티티를 검색합니다', inputSchema: { type: 'object', properties: { query: { type: 'string' }, }, required: ['query'], }, },
- src/index.ts:217-223 (schema)Input schema definition for the 'search_nodes' tool, requiring a 'query' string.inputSchema: { type: 'object', properties: { query: { type: 'string' }, }, required: ['query'], },
- src/index.ts:392-393 (handler)Dispatcher case in the CallToolRequest handler that routes 'search_nodes' calls to the handleSearchNodes method.case 'search_nodes': return await this.handleSearchNodes(args);