Skip to main content
Glama
modelcontextprotocol

Knowledge Graph Memory Server

open_nodes

Retrieve specific entity data by querying node names in the Knowledge Graph Memory Server, enabling persistent memory across interactions.

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

  • Core handler function in KnowledgeGraphManager that filters the knowledge graph to retrieve only the specified entities (nodes) and the relations connecting them.
    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;
  • Registers the 'open_nodes' MCP tool, including input/output schemas and a thin handler wrapper that calls KnowledgeGraphManager.openNodes and formats the response.
    server.registerTool( "open_nodes", { title: "Open Nodes", description: "Open specific nodes in the knowledge graph by their names", inputSchema: { names: z.array(z.string()).describe("An array of entity names to retrieve") }, outputSchema: { entities: z.array(EntitySchema), relations: z.array(RelationSchema) } }, async ({ names }) => { const graph = await knowledgeGraphManager.openNodes(names); return { content: [{ type: "text" as const, text: JSON.stringify(graph, null, 2) }], structuredContent: { ...graph } }; }

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/modelcontextprotocol/knowledge-graph-memory-server'

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