Skip to main content
Glama

open_nodes

Retrieve specific entities from a knowledge graph by providing their names. This tool enables access to structured information for semantic search and analysis within codebases.

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 main handler for the 'open_nodes' tool. Validates the input 'names' array and calls knowledgeGraphManager.openNodes to retrieve the subgraph for specified nodes, formatting the result as a JSON string in the tool response.
    export const openNodesHandler = async (args) => {
        if (!args.names || !Array.isArray(args.names)) {
            throw new Error("The 'names' parameter is required and must be an array");
        }
        // Valider chaque nom
        for (const name of args.names) {
            if (!name || typeof name !== 'string') {
                throw new Error("Each name must be a non-empty string");
            }
        }
        try {
            const nodes = await knowledgeGraphManager.openNodes(args.names);
            return {
                content: [{
                        type: "text",
                        text: JSON.stringify(nodes, null, 2)
                    }]
            };
        }
        catch (error) {
            console.error("Error in open_nodes tool:", error);
            throw error;
        }
    };
  • Tool schema definition for 'open_nodes', specifying the input schema requiring an array of node names.
    export const openNodesTool = {
        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"],
        },
    };
  • Core helper method in KnowledgeGraphManager that loads the graph from file, filters entities by exact name matches, includes only relations between those entities, and returns the induced subgraph.
    async openNodes(names) {
        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 = {
            entities: filteredEntities,
            relations: filteredRelations,
        };
        return filteredGraph;
    }
  • The 'open_nodes' tool is listed among the expected tools to be automatically discovered and registered by the AutoRegistry system, which scans tool directories and registers Tool/Handler pairs.
    export function getExpectedTools() {
        return [
            // Outils Graph (9 outils)
            'create_entities',
            'create_relations',
            'add_observations',
            'delete_entities',
            'delete_observations',
            'delete_relations',
            'read_graph',
            'search_nodes',
            'open_nodes',
            // Outils RAG (5 outils - avec injection_rag comme outil principal)
            'injection_rag', // Nouvel outil principal
            'index_project', // Alias déprécié (rétrocompatibilité)
            'search_code',
            'manage_projects',
            'update_project'
        ];
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'open' but doesn't clarify what 'open' means operationally—whether it retrieves node details, expands them in a UI, or performs some other action. It doesn't disclose permissions needed, rate limits, or what happens if nodes don't exist. For a tool with no annotations, this leaves significant behavioral gaps.

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 with zero waste. It front-loads the core action and resource, making it easy to scan. Every word contributes to understanding the tool's purpose.

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?

Given no annotations and no output schema, the description is incomplete for a tool that likely retrieves or accesses node data. It doesn't explain what 'open' entails behaviorally, what information is returned, or how errors are handled. For a knowledge graph tool with siblings that include mutations, more context is needed to ensure safe and correct use.

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%, with the parameter 'names' fully documented in the schema as 'An array of entity names to retrieve'. The description adds minimal value beyond this, only implying that names are used to identify nodes. Baseline 3 is appropriate since the schema does the heavy lifting.

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 target resource ('specific nodes in the knowledge graph'), specifying they are opened 'by their names'. It distinguishes from siblings like 'search_nodes' (searching) and 'read_graph' (reading entire graph). However, it doesn't explicitly differentiate from 'create_entities' or 'delete_entities' in terms of effect on nodes.

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' (for finding nodes) or 'read_graph' (for broader graph access). It mentions opening nodes 'by their names', which implies you need to know exact names, but doesn't state this as an explicit prerequisite or exclusion.

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

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/ali-48/rag-mcp-server'

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