Skip to main content
Glama
IzumiSy

MCP DuckDB Knowledge Graph Memory Server

delete_observations

Remove specific observations from entities in a knowledge graph to maintain accurate and relevant data.

Instructions

Delete specific observations from entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletionsYesAn array of observation deletions

Implementation Reference

  • Handler function for the delete_observations tool that calls the knowledge graph manager to perform the deletion and returns a success message.
    async ({ deletions }) => {
      await knowledgeGraphManager.deleteObservations(deletions);
      return {
        content: [{ type: "text", text: "Observations deleted successfully" }],
      };
    }
  • src/server.ts:106-129 (registration)
    Registration of the delete_observations MCP tool including description, input schema, and handler reference.
    server.tool(
      "delete_observations",
      "Delete specific observations from entities in the knowledge graph",
      {
        deletions: z
          .array(
            z.object({
              entityName: z
                .string()
                .describe("The name of the entity containing the observations"),
              contents: z
                .array(z.string())
                .describe("An array of observations to delete"),
            })
          )
          .describe("An array of observation deletions"),
      },
      async ({ deletions }) => {
        await knowledgeGraphManager.deleteObservations(deletions);
        return {
          content: [{ type: "text", text: "Observations deleted successfully" }],
        };
      }
    );
  • Zod schema defining the input for delete_observations: array of objects with entityName and contents.
    {
      deletions: z
        .array(
          z.object({
            entityName: z
              .string()
              .describe("The name of the entity containing the observations"),
            contents: z
              .array(z.string())
              .describe("An array of observations to delete"),
          })
        )
        .describe("An array of observation deletions"),
    },
  • Core implementation of observation deletion in KnowledgeGraphManager: performs SQL deletes in transaction and updates search index.
    async deleteObservations(deletions: Array<Observation>): Promise<void> {
      using conn = await this.getConn();
    
      try {
        // Begin transaction
        await conn.execute("BEGIN TRANSACTION");
    
        // Process each deletion
        for (const deletion of deletions) {
          // If there are observations to delete
          if (deletion.contents.length > 0) {
            for (const content of deletion.contents) {
              await conn.execute(
                "DELETE FROM observations WHERE entityName = ? AND content = ?",
                [deletion.entityName, content]
              );
            }
          }
        }
    
        // Commit transaction
        await conn.execute("COMMIT");
    
        // Update Fuse.js index
        const allEntities = await this.getAllEntities();
        this.fuse.setCollection(allEntities);
      } catch (error: unknown) {
        // Rollback in case of error
        await conn.execute("ROLLBACK");
        this.logger.error("Error deleting observations", extractError(error));
        throw error;
      }
    }
  • Type definition for the deleteObservations method in KnowledgeGraphManagerInterface.
    deleteObservations(deletions: Array<Observation>): Promise<void>;
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 provides no additional context about permissions needed, whether deletions are permanent or reversible, rate limits, error conditions, or what happens to related data. For a destructive tool with zero annotation coverage, this is a significant gap.

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 gets straight to the point with zero wasted words. It's appropriately sized for a tool with one main parameter and clear schema documentation.

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 inadequate. It doesn't explain what 'observations' are in this context, what the deletion affects, whether there are side effects, or what the response looks like. The agent lacks crucial context for safe and effective 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%, so the schema already documents the 'deletions' parameter and its nested structure. The description adds no parameter-specific information beyond what's in the schema - it doesn't explain what constitutes an 'observation', format examples, or constraints. Baseline 3 is appropriate when 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 ('Delete') and target ('specific observations from entities in the knowledge graph'), providing a specific verb+resource combination. It distinguishes itself from sibling tools like 'delete_entities' by focusing on observations rather than entire entities. However, it doesn't explicitly differentiate from all siblings (e.g., 'delete_relations' also deletes things).

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 'delete_relations'. It doesn't mention prerequisites, constraints, or typical scenarios for deleting observations versus other deletion operations. The agent must infer usage from the tool name 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/IzumiSy/mcp-duckdb-memory-server'

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