open_nodes
Retrieve complete information for specific nodes in a knowledge graph by their names, including subdomains and metadata, to enhance memory integration in chat applications.
Instructions
Open specific nodes in the knowledge graph by their names. Returns the complete node information including subdomain and all metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | Yes | An array of entity names to retrieve, returning full entity information including subdomain |
Input Schema (JSON Schema)
{
"properties": {
"names": {
"description": "An array of entity names to retrieve, returning full entity information including subdomain",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"names"
],
"type": "object"
}
Implementation Reference
- index.ts:324-339 (handler)The openNodes method in KnowledgeGraphManager that implements the core logic of the 'open_nodes' tool by loading the graph and filtering entities and relations based on the provided names.async openNodes(names: string[]): Promise<KnowledgeGraph> { const graph = await this.loadGraph(); const filteredEntities = graph.entities.filter(e => names.includes(e.name)); const filteredEntityNames = new Set(filteredEntities.map(e => e.name)); const filteredRelations = graph.relations.filter(r => filteredEntityNames.has(r.from) && filteredEntityNames.has(r.to) ); return { entities: filteredEntities, relations: filteredRelations, }; }
- index.ts:525-535 (schema)Input schema for the 'open_nodes' tool, specifying an array of entity names.inputSchema: { type: "object", properties: { names: { type: "array", items: { type: "string" }, description: "An array of entity names to retrieve, returning full entity information including subdomain", }, }, required: ["names"], },
- index.ts:522-536 (registration)Registration of the 'open_nodes' tool in the listTools handler response, including name, description, and input schema.{ name: "open_nodes", description: "Open specific nodes in the knowledge graph by their names. Returns the complete node information including subdomain and all metadata.", inputSchema: { type: "object", properties: { names: { type: "array", items: { type: "string" }, description: "An array of entity names to retrieve, returning full entity information including subdomain", }, }, required: ["names"], }, },
- index.ts:572-573 (registration)Dispatch case in the callToolRequestSchema handler that invokes the openNodes method for the 'open_nodes' tool.case "open_nodes": return createResponse(JSON.stringify(await knowledgeGraphManager.openNodes(args.names as string[]), null, 2));