Skip to main content
Glama

Cache: Delete cache tree

metrecept_delete_cache_tree

Deletes a non-main cache tree and its metadata, digest index, references, and owned cached responses so you can clean up after experiments; main trees and trees with children are refused.

Instructions

Delete a whole non-main cache tree: its metadata, digest index, references and the cached responses it owns. Use it to clean up after an experiment, typically after metrecept_manage_cache_tree promote. Find ids with metrecept_list_cache_trees. Not for a single entry: use metrecept_evict_cache_entry. Destructive and immediate, no undo; not billed. Refuses "main" (409 cannot_delete_main) and trees with children (409 tree_has_children; delete children first). Responses another tree references after a promote are kept until their TTL. A missing or already-deleted tree returns 404 tree_missing. Requires a Metrecept API key (METRECEPT_API_KEY env on stdio, or Authorization: Bearer on remote HTTP); results are scoped to that key's tenant only.

Input Schema

NameRequiredDescriptionDefault
tree_idYesId of the tree to delete; any tree except "main".

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.1
    • addedInput schema / properties / tree_id / description
      Added value: +"Id of the tree to delete; any tree except \"main\"."
  2. Addedv0.1.4

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so well: destructive and immediate with no undo, not billed, refuses main and trees with children with specific 409 codes, missing trees return 404, referenced responses are kept until TTL, and the API-key/tenant scoping is explained.

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?

The description is dense but front-loaded and every sentence contributes useful guidance. It is longer than strictly necessary, but the length is justified by the operational caveats and error behavior it must disclose.

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?

An output schema exists, so return values need not be explained. The description supplies the constraints, error cases, authentication requirements, and sibling routing needed to invoke this destructive tool 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 coverage is 100% and the only parameter is documented, including the restriction that it can be any tree except main. The description adds no parameter-level detail beyond the schema, so the baseline of 3 applies.

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 description gives a specific verb and resource: delete a whole non-main cache tree, including its metadata, digest index, references, and owned cached responses. It distinguishes the operation from sibling alternatives such as metrecept_evict_cache_entry and metrecept_list_cache_trees.

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 explicitly states when to use it: cleaning up after an experiment, typically after metrecept_manage_cache_tree promote. It names the alternative for single-entry deletion and points to metrecept_list_cache_trees for finding ids.

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