Skip to main content
Glama
j3k0

Elasticsearch Knowledge Graph for MCP

by j3k0

open_nodes

Retrieve detailed information about specific entities and their relationships within the Elasticsearch Knowledge Graph, enabling structured querying and analysis for AI models.

Instructions

Get details about specific entities in knowledge graph (memory) and their relations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memory_zoneYesOptional memory zone to retrieve entities from. If not specified, uses the default zone.
namesYesNames of entities to retrieve

Implementation Reference

  • Handler implementation for the 'open_nodes' tool. Fetches specified entities and their inter-relations from the knowledge graph (using kgClient), formats the data, and returns it via formatResponse.
    else if (toolName === "open_nodes") {
      const names = params.names || [];
      const zone = params.memory_zone;
      
      // Get the entities
      const entities: ESEntity[] = [];
      for (const name of names) {
        const entity = await kgClient.getEntity(name, zone);
        if (entity) {
          entities.push(entity);
        }
      }
      
      // Format entities
      const formattedEntities = entities.map(e => ({
        name: e.name,
        entityType: e.entityType,
        observations: e.observations
      }));
      
      // Get relations between these entities
      const entityNames = formattedEntities.map(e => e.name);
      const { relations } = await kgClient.getRelationsForEntities(entityNames, zone);
      
      // Map relations to the expected format
      const formattedRelations = relations.map(r => ({
        from: r.from,
        to: r.to,
        type: r.relationType,
        fromZone: r.fromZone,
        toZone: r.toZone
      }));
      
      return formatResponse({ entities: formattedEntities, relations: formattedRelations });
    }
  • JSON schema definition for the 'open_nodes' tool input, specifying properties 'names' (required array of strings) and 'memory_zone' (required string), returned in ListTools response for tool registration.
    {
      name: "open_nodes",
      description: "Get details about specific entities in knowledge graph (memory) and their relations",
      inputSchema: {
        type: "object",
        properties: {
          names: {
            type: "array",
            items: {type: "string"},
            description: "Names of entities to retrieve"
          },
          memory_zone: {
            type: "string",
            description: "Optional memory zone to retrieve entities from. If not specified, uses the default zone."
          }
        },
        required: ["names", "memory_zone"],
        additionalProperties: false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    },
  • src/index.ts:649-651 (registration)
    Registration of all tools including 'open_nodes' via the ListToolsRequestHandler, which returns the tool list containing the schema for open_nodes.
    });
    
    // Register the call tool handler to handle tool executions
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves details about entities and relations, implying a read-only operation, but doesn't mention permissions, rate limits, error handling, or what 'details' include (e.g., properties, metadata). For a tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence that front-loads the core purpose ('Get details about specific entities...'). There is no wasted text, and it directly communicates the tool's function without unnecessary elaboration.

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

Completeness3/5

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

Given the tool's moderate complexity (2 required parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, or differentiation from siblings. With no output schema, it should ideally hint at return values, but the concise purpose statement meets a bare-minimum threshold.

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 documents both parameters ('names' and 'memory_zone') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or edge cases, but the high schema coverage justifies the baseline score of 3.

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 verb ('Get details') and resource ('specific entities in knowledge graph (memory) and their relations'), making the purpose understandable. However, it doesn't explicitly distinguish this tool from sibling tools like 'search_nodes' or 'get_recent', which might have overlapping functionality for retrieving graph information.

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?

The description provides no guidance on when to use this tool versus alternatives like 'search_nodes' (which might search broadly) or 'get_recent' (which might retrieve recent entities). It lacks explicit when/when-not instructions or named alternatives, leaving usage context implied at best.

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/j3k0/mcp-brain-tools'

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