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 }
        };
      }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral context. It doesn't disclose whether this is a read-only operation, what 'open' entails (e.g., retrieves metadata, expands relationships), error handling for non-existent names, or any rate limits/permissions needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, zero waste. Every word contributes to the purpose statement, and it's appropriately front-loaded with the core action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and multiple siblings, the description is inadequate. It lacks crucial context about what 'open' returns, how it differs from other read operations, and behavioral traits needed for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents the 'names' parameter. The description adds no additional meaning beyond implying these are 'entity names', which is redundant with the schema's 'entity names to retrieve'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('open') and resource ('specific nodes in the knowledge graph'), with the qualifier 'by their names' adding specificity. It distinguishes from siblings like 'read_graph' (general reading) and 'search_nodes' (search-based retrieval), but doesn't explicitly contrast them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like 'read_graph' or 'search_nodes'. The description implies usage when you know exact node names, but doesn't state when-not to use it or name specific alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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