open_nodes
Open specific nodes in a knowledge graph by name to retrieve stored AI memories as Markdown files for visualization in Obsidian's graph view.
Instructions
Open specific nodes in the knowledge graph by their names
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | Yes | An array of entity names to retrieve |
Implementation Reference
- The core implementation of the open_nodes tool. Loads the full knowledge graph, filters entities by the provided names, filters relations to only those between the selected entities, and returns the subgraph.async openNodes(names: string[]): Promise<KnowledgeGraph> { const graph = await this.loadGraph(); // Filter entities const filteredEntities = graph.entities.filter(e => names.includes(e.name)); // Get filtered entity names const filteredEntityNames = new Set(filteredEntities.map(e => e.name)); // Filter relations const filteredRelations = graph.relations.filter(r => filteredEntityNames.has(r.from) && filteredEntityNames.has(r.to) ); return { entities: filteredEntities, relations: filteredRelations }; }
- index.ts:184-198 (schema)The input schema and metadata for the open_nodes tool, defining it accepts an array of entity names.{ 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: "An array of entity names to retrieve", }, }, required: ["names"], }, },
- index.ts:230-231 (registration)The registration and dispatch handler in the MCP tool call switch statement, which invokes the storageManager.openNodes method with the provided arguments and formats the response.case "open_nodes": return { content: [{ type: "text", text: JSON.stringify(await storageManager.openNodes(args.names as string[]), null, 2) }] };