open_nodes
Retrieve complete information from the knowledge graph by specifying entity names to access stored data including subdomains and metadata.
Instructions
Open specific nodes in the knowledge graph by their names. Returns the complete node information including subdomain and all metadata.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | Yes | An array of entity names to retrieve, returning full entity information including subdomain |
Implementation Reference
- index.ts:324-339 (handler)The core handler function that implements the 'open_nodes' tool logic. It loads the knowledge graph, filters entities by the provided names, finds connecting relations, and returns the subgraph.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:522-536 (registration)Registers the 'open_nodes' tool in the list of tools returned by ListToolsRequest, including its 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:525-535 (schema)Defines the input schema for the 'open_nodes' tool, specifying an object with a required 'names' array of strings.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 (helper)The dispatch case in the CallToolRequest handler that invokes the openNodes method on the knowledgeGraphManager instance.case "open_nodes": return createResponse(JSON.stringify(await knowledgeGraphManager.openNodes(args.names as string[]), null, 2));