Skip to main content
Glama

delete_observations

Remove specific observations from entities by matching exact text, enabling precise data cleanup in the Memento memory server.

Instructions

Remove specific observations from entities by matching text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletionsYesList of {entityName, observations} deletion requests.

Implementation Reference

  • MCP tool handler and registration for 'delete_observations'. Includes input schema validation using Zod and delegates to KnowledgeGraphManager.deleteObservations.
    // Tool: delete_observations
    this.tool(
        'delete_observations',
        'Remove specific observations from entities by matching text.',
        {
            deletions: z.array(z.object({
                entityName:   z.string().describe('Name of the entity.'),
                observations: z.array(z.string()).describe('Exact observation texts to delete.')
            })).describe('List of {entityName, observations} deletion requests.')
        },
        async ({ deletions }) => {
            await this.#knowledgeGraphManager.deleteObservations(deletions);
            return { content: [{ type: 'text', text: 'Observations deleted' }] };
        }
    );
  • Helper method in KnowledgeGraphManager that resolves entity names to IDs and calls the repository's deleteObservations for each entry.
    async deleteObservations(list) {
        for (const { entityName, observations } of list) {
            const entityId = await this.#repository.getEntityId(entityName);
            if (!entityId) continue;
            await this.#repository.deleteObservations(entityId, observations);
        }
    }
  • SQLite repository implementation of deleteObservations: executes SQL DELETE on observations table matching entity_id and content.
    async deleteObservations(entityId, observations) {
        if (!observations.length) {
            return;
        }
    
        const placeholders = observations.map(() => '?').join(',');
        await this.db.run(
            `DELETE FROM observations WHERE entity_id = ? AND content IN (${placeholders})`,
            [entityId, ...observations]
        );
    }
  • PostgreSQL repository implementation of deleteObservations: executes SQL DELETE using ANY array for observations content.
    async deleteObservations(entityId, observations) {
        if (!observations.length) {
            return;
        }
    
        await this.#query(
            `DELETE
             FROM observations
             WHERE entity_id = $1
               AND content = ANY ($2)`,
            [ entityId, observations ]
        );
    }
  • Interface definition (JSDoc) for the GraphRepository deleteObservations method.
    * @property {(entityId: number|string, observations: string[]) => Promise<void>} deleteObservations
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. While 'Remove' implies a destructive mutation, it doesn't specify whether deletions are permanent, reversible, or require specific permissions. It mentions 'matching text' but doesn't clarify if this is exact or fuzzy matching, or what happens on partial matches. Significant behavioral gaps remain unaddressed.

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. Every word earns its place in conveying the essential functionality.

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 and no output schema, the description is insufficient. It doesn't address critical aspects like what constitutes a successful deletion, error conditions, return values, or side effects. The agent lacks necessary context to use this tool safely and effectively despite the good schema coverage.

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%, providing complete parameter documentation. The description adds marginal value by implying the 'matching text' mechanism relates to the 'observations' array parameter, but doesn't elaborate beyond what the schema already states about exact text matching. Baseline 3 is appropriate when 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 ('Remove') and target ('observations from entities'), specifying the mechanism ('by matching text'). It distinguishes from siblings like 'delete_entities' by focusing on observations rather than entire entities. However, it doesn't explicitly contrast with 'add_observations' beyond the obvious 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 use cases. The agent must infer usage from the tool name and description alone without explicit context.

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/iAchilles/memento'

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