Skip to main content
Glama
BRO3886

Memory Custom

by BRO3886

delete_entities

Remove entities and their relationships from a knowledge graph stored in a specified memory file to maintain data accuracy and relevance.

Instructions

Delete multiple entities and their associated relations from the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNamesYesAn array of entity names to delete
memoryFilePathYesThe path to the memory file

Implementation Reference

  • The handler function in KnowledgeGraphManager that implements the deletion of specified entities and all relations connected to them from the graph stored in the memory file.
    async deleteEntities(entityNames: string[], filepath: string): Promise<void> {
      await this.setMemoryFilePath(filepath);
      const graph = await this.loadGraph();
      graph.entities = graph.entities.filter(
        (e) => !entityNames.includes(e.name)
      );
      graph.relations = graph.relations.filter(
        (r) => !entityNames.includes(r.from) && !entityNames.includes(r.to)
      );
      await this.saveGraph(graph);
    }
  • The tool schema definition including name, description, and input schema for validating parameters (entityNames array and memoryFilePath).
      name: "delete_entities",
      description:
        "Delete multiple entities and their associated relations from the knowledge graph",
      inputSchema: {
        type: "object",
        properties: {
          entityNames: {
            type: "array",
            items: { type: "string" },
            description: "An array of entity names to delete",
          },
          memoryFilePath: {
            type: "string",
            description: "The path to the memory file",
          },
        },
        required: ["entityNames", "memoryFilePath"],
      },
    },
  • index.ts:653-660 (registration)
    The dispatch case in the CallToolRequestHandler switch statement that invokes the deleteEntities handler with parsed arguments and returns success response.
    case "delete_entities":
      await knowledgeGraphManager.deleteEntities(
        args.entityNames as string[],
        args.memoryFilePath as string
      );
      return {
        content: [{ type: "text", text: "Entities deleted successfully" }],
      };
Behavior2/5

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

With no annotations, the description carries full burden but only states the deletion action without disclosing critical behavioral traits. It doesn't mention if deletion is permanent, requires specific permissions, affects related data beyond relations, or has rate limits. The phrase 'and their associated relations' adds some context but is insufficient for a mutation tool.

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 directly states the action, scope, and resource without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse.

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 the tool's complexity as a destructive mutation with no annotations and no output schema, the description is incomplete. It lacks details on behavior, error handling, return values, or safety considerations, leaving significant gaps for an agent to use it correctly.

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 both parameters fully. The description adds no additional meaning beyond implying 'entityNames' refers to entities in a knowledge graph, which is redundant with the schema. Baseline 3 is appropriate as 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 multiple entities and their associated relations') and the resource ('from the knowledge graph'), making the purpose unambiguous. It distinguishes from siblings like 'delete_observations' and 'delete_relations' by specifying entities and their relations, though it doesn't explicitly contrast them.

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?

No guidance is provided on when to use this tool versus alternatives like 'delete_observations' or 'delete_relations', nor does it mention prerequisites such as needing existing entities. The description implies usage for bulk deletion but lacks explicit context or exclusions.

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/BRO3886/mcp-memory-custom'

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