search_nodes
Search for entities in a knowledge graph synchronized with GitHub repositories to find memory data, relationships, and observations stored remotely.
Instructions
엔티티를 검색합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- src/index.ts:546-560 (handler)The MCP tool handler for 'search_nodes'. It calls memoryManager.searchNodes and returns formatted JSON response with 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/index.ts:217-223 (schema)Input schema defining the expected arguments for the search_nodes tool: a required 'query' string.inputSchema: { type: 'object', properties: { query: { type: 'string' }, }, required: ['query'], },
- src/index.ts:214-225 (registration)Registration of the search_nodes tool in the tools list returned by ListToolsRequestHandler, including name, description, and input schema.{ name: 'search_nodes', description: '엔티티를 검색합니다', inputSchema: { type: 'object', properties: { query: { type: 'string' }, }, required: ['query'], }, }, {
- src/memory-graph.ts:122-139 (helper)Core helper method implementing the search logic: finds entities where query matches name, entityType, or any observation (case-insensitive).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; }