Skip to main content
Glama

delete_entities

Remove specified entities and their related connections from the knowledge graph to maintain accurate and relevant data structures within the MCP Think Tank server.

Instructions

Delete multiple entities and their associated relations from the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNamesYesArray of entity names to delete

Implementation Reference

  • The execute handler function for the delete_entities tool. It iterates over the provided entityNames, deletes each using graph.deleteEntity, tracks deleted and not-found entities, saves changes to memoryStore, and returns a JSON string with results.
    execute: async (args) => {
      const results = {
        deleted: [] as string[],
        notFound: [] as string[]
      };
    
      // Using the lower-level graph for entity deletion for now
      // In a future update, we can add entity deletion to the MemoryStore itself
      for (const entityName of args.entityNames) {
        const success = graph.deleteEntity(entityName);
        if (success) {
          results.deleted.push(entityName);
        } else {
          results.notFound.push(entityName);
        }
      }
    
      // Save changes
      await memoryStore.save();
    
      // Return as string
      return JSON.stringify({
        deleted: results.deleted.length > 0 ? results.deleted : null,
        notFound: results.notFound.length > 0 ? results.notFound : null,
        message: `Deleted ${results.deleted.length} entities. ${results.notFound.length} entities not found.`
      });
    }
  • The server.addTool call that registers the delete_entities tool, specifying name, description, parameters schema, and execute handler.
    server.addTool({
      name: 'delete_entities',
      description: 'Delete multiple entities and their associated relations from the knowledge graph',
      parameters: Schemas.DeleteEntitiesSchema,
      execute: async (args) => {
        const results = {
          deleted: [] as string[],
          notFound: [] as string[]
        };
    
        // Using the lower-level graph for entity deletion for now
        // In a future update, we can add entity deletion to the MemoryStore itself
        for (const entityName of args.entityNames) {
          const success = graph.deleteEntity(entityName);
          if (success) {
            results.deleted.push(entityName);
          } else {
            results.notFound.push(entityName);
          }
        }
    
        // Save changes
        await memoryStore.save();
    
        // Return as string
        return JSON.stringify({
          deleted: results.deleted.length > 0 ? results.deleted : null,
          notFound: results.notFound.length > 0 ? results.notFound : null,
          message: `Deleted ${results.deleted.length} entities. ${results.notFound.length} entities not found.`
        });
      }
    });
  • Zod schema defining the input parameters for the delete_entities tool: an array of entity names to delete.
    export const DeleteEntitiesSchema = z.object({
      entityNames: z.array(z.string().min(1)).describe('Array of entity names to delete')
    });
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 it correctly indicates this is a destructive operation ('Delete'), it doesn't mention important behavioral aspects like whether deletions are permanent/reversible, what permissions are required, whether there are rate limits, what happens to orphaned relations, or what the response looks like. For a destructive operation with zero annotation coverage, this is insufficient.

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 communicates the core purpose without any wasted words. It's appropriately sized for a tool with one parameter and gets straight to the point with no unnecessary elaboration.

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 operation with no annotations and no output schema, the description is incomplete. It doesn't address critical context like error conditions, confirmation requirements, side effects on related data, or response format. Given the complexity of deleting entities with associated relations in a knowledge graph, more behavioral context is needed 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 fully documents the single parameter 'entityNames'. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., format examples, constraints on entity names, batch size limits). With complete schema coverage, 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 ('Delete') and target resources ('multiple entities and their associated relations from the knowledge graph'), providing specific verb+resource information. However, it doesn't explicitly distinguish this tool from sibling tools like 'delete_observations' or 'delete_relations', which handle different resource types in the same system.

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. There are multiple sibling deletion tools (delete_observations, delete_relations) that handle different resource types, but the description doesn't explain when this specific entity deletion tool is appropriate versus those alternatives or mention any prerequisites or constraints for its use.

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

Related 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/flight505/mcp-think-tank'

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