Skip to main content
Glama
itseasy21

Knowledge Graph Memory Server

open_nodes

Retrieve specific nodes from a knowledge graph by entity names, enabling AI systems to access and utilize stored user information across conversations efficiently.

Instructions

Open specific nodes in the knowledge graph by their names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namesYesAn array of entity names to retrieve

Implementation Reference

  • The openNodes method in KnowledgeGraphManager class implements the core logic for the 'open_nodes' tool: loads the full graph, filters entities by the provided names, filters relations to only those connecting the selected entities, and returns the resulting subgraph.
    async openNodes(names: string[]): Promise<KnowledgeGraph> { const graph = await this.loadGraph(); // Filter entities const filteredEntities = graph.entities.filter(e => names.includes(e.name)); // Create a Set of filtered entity names for quick lookup const filteredEntityNames = new Set(filteredEntities.map(e => e.name)); // Filter relations to only include those between filtered entities const filteredRelations = graph.relations.filter(r => filteredEntityNames.has(r.from) && filteredEntityNames.has(r.to) ); const filteredGraph: KnowledgeGraph = { entities: filteredEntities, relations: filteredRelations, }; return filteredGraph; }
  • Input schema definition for the 'open_nodes' tool in the ListToolsRequestSchema handler, specifying an object with a required 'names' array of strings.
    { 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:533-534 (registration)
    The switch case in CallToolRequestSchema handler that registers and invokes the 'open_nodes' tool by calling knowledgeGraphManager.openNodes with the provided arguments and returning the JSON-stringified result.
    case "open_nodes": return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.openNodes(args.names as string[]), null, 2) }] };

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itseasy21/mcp-knowledge-graph'

If you have feedback or need assistance with the MCP directory API, please join our Discord server