Skip to main content
Glama
AgentWong

Knowledge Graph Memory Server

by AgentWong

Open Nodes

open_nodes

Retrieve specific entities from a knowledge graph by name to access stored user information across conversations.

Instructions

Open specific nodes in the knowledge graph by their names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namesYesAn array of entity names to retrieve

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
entitiesYes
relationsYes

Implementation Reference

  • The core implementation of the open_nodes tool, which retrieves entities and their relations from the SQLite database.
    async def open_nodes(self, names: List[str]) -> Dict[str, List[Dict[str, Any]]]:
        """Retrieve specific nodes and their relations."""
        async with self.pool.get_connection() as conn:
            sanitized_names = [sanitize_input(name) for name in names]
            placeholders = ','.join('?' * len(sanitized_names))
            
            # Get entities
            cursor = await conn.execute(
                f"SELECT * FROM entities WHERE name IN ({placeholders})",
                sanitized_names
            )
            rows = await cursor.fetchall()
            entities = []
            for row in rows:
                entity = Entity(
                    name=row['name'],
                    entityType=row['entity_type'],
                    observations=row['observations'].split(',') if row['observations'] else []
                )
                entities.append(entity.to_dict())
    
            relations = await self._get_relations_for_entities(conn, set(names))
            return {"entities": entities, "relations": relations}
  • Registration of the open_nodes tool in the main server setup.
    types.Tool(
        name="open_nodes",
        description="Retrieve specific nodes by name",
        inputSchema={
            "type": "object",
            "properties": {
                "names": {
                    "type": "array",
                    "items": {"type": "string"}
                }
            },
            "required": ["names"],
            "additionalProperties": False
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 what the tool does but lacks critical details: whether 'open' implies read-only access or modification, what happens if nodes don't exist (e.g., errors or graceful handling), the format of returned data, or any side effects like caching. This is inadequate for a tool with no annotation coverage.

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 parse. Every word contributes directly to understanding the tool's purpose.

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 (opening nodes by name), the description is minimally complete. It states the purpose but lacks behavioral details. However, the presence of an output schema mitigates the need to explain return values in the description. The gaps in usage guidelines and transparency keep it at an adequate but not fully helpful level.

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' clearly documented as 'An array of entity names to retrieve'. The description adds minimal value beyond the schema, only implying that nodes are opened by name. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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'), with the method specified ('by their names'). It distinguishes from siblings like 'read_graph' (which likely reads the entire graph) and 'search_nodes' (which likely searches rather than opens specific nodes). However, it doesn't explicitly contrast with these siblings, keeping it at 4 rather than 5.

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. It doesn't mention prerequisites (e.g., nodes must exist), exclusions (e.g., not for creating or deleting nodes), or comparisons to siblings like 'read_graph' or 'search_nodes'. The agent must infer usage from the name and context alone.

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/AgentWong/optimized-memory-mcp-server'

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