Skip to main content
Glama

kb_delete

Destructive

Delete knowledge-base entities or exact relationship triples after dependency checks, with dryRun previews and plan-based handling for authored sources.

Instructions

Delete entities by ID, or exact relationship triples. Use only for intentional removals after dependency checks. Do not use as a bulk cleanup shortcut. An entity authored in a Markdown or YAML source is not deleted directly: the call writes nothing and returns outcome plan_returned with a hash-bound deletionPlan and a nextActions entry holding the exact kb_apply_plan input ({plan, approvedPlanHash}); apply that unmodified, or repeat this call with approvedPlanHash = deletionPlan.planHash to apply the freshly computed plan in one step (a stale or different hash fails with DELETE_PLAN_HASH_MISMATCH and writes nothing). Authored requirements are never deleted: outcome supersession_required points to kb_upsert with a supersedes relationship. dryRun:true previews any delete and writes nothing. Side effects: mutates and saves KB and authored sources; skips entities with dependents; dryRun and plan_returned write nothing.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "kb_delete"
  }
}

Input Schema

NameRequiredDescriptionDefault
idsNoEntity IDs to delete after dependency checks.
dryRunNoPreview without writing: returns what a commit would delete and write.
relationshipsNoExact relationship triples to retract, including legacy shard records.
workspaceRootNoOptional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's.
approvedPlanHashNoWith ids only: the deletionPlan.planHash a prior call returned; applied only while the hash still matches.

Output Schema

NameRequiredDescriptionDefault
dataYes
errorNo
statusYes
effectsYes
operationYes
diagnosticsYes
nextActionsYes
kibiProtocolYes
resultVersionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.1.10
    • changedInput schema / properties / approvedPlanHash / description
      Previous value: -"With ids only: the deletionPlan.planHash a prior call for the same ids returned. The plan is recomputed and applied through kb_apply_plan when its hash still matches; a mismatch fails with DELETE_PLAN_HASH_MISMATCH and writes nothing. Not allowed with relationships or dryRun."New value: +"With ids only: the deletionPlan.planHash a prior call returned; applied only while the hash still matches."
    • changedInput schema / properties / dryRun / description
      Previous value: -"Preview without writing. Relationship and direct entity deletes run their preflight and return outcome dry_run with wouldDelete counts, the sourceWrites (paths and hashes) a commit would make, and skippedEffects. Authored ids return the same deletion plan as without dryRun."New value: +"Preview without writing: returns what a commit would delete and write."
    • changedInput schema / properties / workspaceRoot / description
      Previous value: -"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available."New value: +"Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's."
    • removedOutput schema / properties / data / properties / outcome / anyOf
      Removed value: -[
      -  {
      -    "const": "plan_returned",
      -    "type": "string"
      -  },
      -  {
      -    "const": "supersession_required",
      -    "type": "string"
      -  },
      -  {
      -    "const": "plan_applied",
      -    "type": "string"
      -  },
      -  {
      -    "const": "dry_run",
      -    "type": "string"
      -  }
      -]
    • addedOutput schema / properties / data / properties / outcome / enum
      Added value: +[
      +  "plan_returned",
      +  "supersession_required",
      +  "plan_applied",
      +  "dry_run"
      +]
    • addedOutput schema / properties / data / properties / outcome / type
      Added value: +"string"
    • removedOutput schema / properties / diagnostics / items / properties / severity / anyOf
      Removed value: -[
      -  {
      -    "const": "info",
      -    "type": "string"
      -  },
      -  {
      -    "const": "warning",
      -    "type": "string"
      -  },
      -  {
      -    "const": "error",
      -    "type": "string"
      -  }
      -]
    • addedOutput schema / properties / diagnostics / items / properties / severity / enum
      Added value: +[
      +  "info",
      +  "warning",
      +  "error"
      +]
    • addedOutput schema / properties / diagnostics / items / properties / severity / type
      Added value: +"string"
    • removedOutput schema / properties / effects / items / properties / status / anyOf
      Removed value: -[
      -  {
      -    "const": "completed",
      -    "type": "string"
      -  },
      -  {
      -    "const": "failed",
      -    "type": "string"
      -  },
      -  {
      -    "const": "not_applicable",
      -    "type": "string"
      -  }
      -]
    • addedOutput schema / properties / effects / items / properties / status / enum
      Added value: +[
      +  "completed",
      +  "failed",
      +  "not_applicable"
      +]
    • addedOutput schema / properties / effects / items / properties / status / type
      Added value: +"string"
    • removedOutput schema / properties / status / anyOf
      Removed value: -[
      -  {
      -    "const": "success",
      -    "type": "string"
      -  },
      -  {
      -    "const": "committed_with_repairs",
      -    "type": "string"
      -  },
      -  {
      -    "const": "error",
      -    "type": "string"
      -  }
      -]
    • addedOutput schema / properties / status / enum
      Added value: +[
      +  "success",
      +  "committed_with_repairs",
      +  "error"
      +]
    • addedOutput schema / properties / status / type
      Added value: +"string"
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description goes well beyond them: authored Markdown/YAML entities write nothing and instead return outcome plan_returned with a hash-bound deletionPlan, stale hashes fail with DELETE_PLAN_HASH_MISMATCH and write nothing, authored requirements return supersession_required, dryRun previews without writing, and entities with dependents are skipped. These are non-obvious, high-value behavioral facts an agent cannot get from the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with purpose and the exclusion before the plan mechanics, and every sentence carries substantive information. The trade-off is density: the approvedPlanHash parenthetical and the outcome-name clauses are packed into long compound sentences that could be broken out for faster scanning.

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?

For a destructive tool with a multi-step plan/hash flow, the description covers side effects, the no-write cases, the error condition, and the handoff to sibling tools, while an output schema exists to carry return shape. Nothing an agent needs in order to call it safely is missing.

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, but the description adds real meaning: it explains that approvedPlanHash must match the freshly computed planHash, that mismatches write nothing, and that dryRun previews any delete. It adds less about ids/relationships/workspaceRoot than the schema already conveys, so it falls short of a 5.

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?

The first sentence states a specific verb and resource plus both addressing modes: 'Delete entities by ID, or exact relationship triples.' It is immediately distinguishable from kb_upsert (which writes) and kb_apply_plan (which applies a plan), since the description explains how deletion flows through them rather than duplicating their role.

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?

It gives explicit when-to-use ('only for intentional removals after dependency checks'), explicit when-not ('Do not use as a bulk cleanup shortcut'), and names concrete alternatives for the blocked cases: kb_apply_plan for applying a returned plan and kb_upsert with a supersedes relationship for authored requirements. An agent has nothing to infer about routing.

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