Skip to main content
Glama

deleteEntity

Hard-delete an entity by ULID, removing its derived data and audit-tombstoning it; active relations block deletion unless cascade=true is set.

Instructions

Hard-delete an entity by ULID: removes the entity and all its derived data (relations, facts, mentions, identifiers, citations) and detaches its graph node, appending an entityDeleted tombstone to the audit log. This is for unwanted or junk entities — to consolidate DUPLICATES without losing data use mergeEntities instead. Safe default: refuses with E_VALIDATION when the entity still has active relations (so a connected entity is never dropped by accident); pass cascade=true to tombstone those relations first and proceed. Returns E_NOT_FOUND when the uid is unknown.

Input Schema

NameRequiredDescriptionDefault
reasonNoOptional free-text reason for the deletion. Surfaced in audit/log views and stamped on the cascaded relationForgotten tombstones.
cascadeNoDelete the entity even when it still has active relations. When true, each active relation is first tombstoned (relationForgotten) for the audit trail, then the entity and all its remaining derived data (facts, mentions, identifiers, citations) are removed. When false (default) the delete is REFUSED if any active relation exists, so a well-connected entity is never dropped by accident — merge it with mergeEntities instead, or pass cascade to confirm. Defaults to false.
entityUidYesULID of the entity to delete. Required.

Output Schema

NameRequiredDescriptionDefault
nameYesAIP resource name of the deleted entity.
statusYesAlways "deleted" on success.
forgottenRelationsNoNumber of active relations tombstoned by the cascade before the entity was removed (0 unless cascade was needed).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so: it discloses irreversible hard-delete scope, the safety refusal (E_VALIDATION), the E_NOT_FOUND case, tombstone/audit side effects, and that cascade tombstones relations first. That is exactly the pre-call risk context an agent needs for a destructive operation.

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?

Front-loaded with the destructive action and scope, followed by the alternative, the default safety behavior, and the error case in that priority order. Dense but every clause adds distinct decision-relevant information; no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers everything an agent needs before a destructive call: what is destroyed, what happens to connected data, the safe default, how to override it, which sibling to prefer, and failure modes. An output schema exists, so the description is not obliged to explain return payloads, and it doesn't waste space doing so.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description nonetheless adds semantic consequence beyond the schema by framing cascade as a confirmation gate ('pass cascade=true to tombstone those relations first and proceed') rather than just a boolean. It adds less for entityUid and reason, which the schema already documents thoroughly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource+identifier type: 'Hard-delete an entity by ULID', then enumerates exactly what is removed (relations, facts, mentions, identifiers, citations, graph node, audit tombstone). It explicitly distinguishes itself from mergeEntities, so an agent can tell which destructive tool applies without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States the intended case ('unwanted or junk entities') and the alternative with its condition ('to consolidate DUPLICATES without losing data use mergeEntities instead'). Also gives the operational branch: default refusal on active relations vs. cascade=true to proceed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.