Skip to main content
Glama
AgentWong

Knowledge Graph Memory Server

by AgentWong

Delete Observations

delete_observations

Remove specific observations from entities in the knowledge graph to maintain accurate memory by deleting outdated or incorrect information.

Instructions

Delete specific observations from entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletionsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes
successYes

Implementation Reference

  • The actual database operation implementation for deleting observations from an entity.
    async def delete_observations(
        self, 
        deletions: List[Dict[str, Any]], 
        batch_size: int = 1000
    ) -> None:
        """Remove specific observations from entities using batch processing."""
        async with self.pool.get_connection() as conn:
            async with self.pool.transaction(conn):
                for i in range(0, len(deletions), batch_size):
                    batch = deletions[i:i + batch_size]
                    
                    for deletion in batch:
                        entity_name = sanitize_input(deletion["entityName"])
                        to_delete = set(deletion["observations"])
    
                        cursor = await conn.execute(
                            "SELECT observations FROM entities WHERE name = ?",
                            (entity_name,)
                        )
                        result = await cursor.fetchone()
                        if result:
                            current_obs = result['observations'].split(',') if result['observations'] else []
                            updated_obs = [obs for obs in current_obs if obs not in to_delete]
                            
                            await conn.execute(
                                "UPDATE entities SET observations = ? WHERE name = ?",
                                (','.join(updated_obs), entity_name)
                            )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a deletion operation (implying mutation/destructive action) but doesn't describe permissions needed, whether deletions are permanent/reversible, rate limits, or what happens to related data. For a destructive tool with zero annotation coverage, 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 wasted words. It's front-loaded with the core action and target, making it immediately understandable despite its brevity.

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 destructive mutation tool with no annotations, 0% schema description coverage, but with an output schema, the description is inadequate. It doesn't explain what 'observations' are in this context, how deletions affect the knowledge graph, error conditions, or return values. The existence of an output schema helps but doesn't compensate for the lack of behavioral and semantic context.

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 schema has 0% description coverage, so parameters are undocumented in structured fields. The description mentions 'specific observations from entities' which hints at the 'entityName' and 'observations' parameters, but doesn't explain what constitutes valid entity names or observation values, nor the structure of the 'deletions' array. It adds minimal semantic context beyond what's inferable from parameter names.

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 ('Delete') and target ('specific observations from entities in the knowledge graph'), which is a specific verb+resource combination. It distinguishes from siblings like 'delete_entities' by focusing on observations rather than entire entities, but doesn't explicitly contrast with 'add_observations' beyond the verb difference.

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 'delete_entities' or 'add_observations'. It doesn't mention prerequisites, constraints, or typical scenarios for deleting observations rather than other operations.

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