Skip to main content
Glama
itseasy21

Knowledge Graph Memory Server

by itseasy21

open_nodes

Retrieve specific entities from a knowledge graph by name to access stored information across conversations, enabling persistent memory for AI 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

  • The core handler function in KnowledgeGraphManager that loads the graph, filters entities by the provided names, includes only relations between those entities, and returns the filtered 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;
    }
  • The tool schema definition including name, description, and input schema specifying 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:533-534 (registration)
    The switch case in the CallToolRequestSchema handler that dispatches the call to knowledgeGraphManager.openNodes.
    case "open_nodes":
      return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.openNodes(args.names as string[]), null, 2) }] };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of disclosing behavior. It only says 'open', which implies read-only retrieval, but does not explicitly state that it is non-mutating, what it returns, or how missing names are handled. This leaves significant ambiguity.

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?

The description is a single, efficiently worded sentence that directly states the action and resource. It contains no filler or redundant information.

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?

The tool has no output schema and the description does not clarify what 'open' returns (e.g., node attributes, observations, relations). For an agent to invoke the tool and interpret results correctly, this missing information is a notable gap.

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?

The input schema has 100% coverage, already describing 'names' as 'An array of entity names to retrieve'. The tool description merely restates 'by their names', adding no extra semantic detail beyond the schema, so the baseline of 3 applies.

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 uses the specific verb 'Open' and identifies the resource 'nodes in the knowledge graph', scoped by 'names', making it clear this is a direct retrieval by exact names. It implicitly differentiates from search_nodes (searching) and read_graph (full graph), but does not explicitly name alternatives.

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 guidance is given on when to use this tool versus siblings. The description does not state that it should be used when exact node names are known, nor does it exclude using search_nodes for lookup or read_graph for broader context.

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