Skip to main content
Glama

Delete Trace

delete_trace
Destructive

Remove one stored trace by ID, deleting its spans while preserving linked evaluation verdicts and scores but erasing their text; every deletion is audited.

Instructions

Remove one stored trace by id; its spans go with it, and every evaluation linked to it keeps its verdict and loses its text.

What it does. Linked evaluations keep their verdicts and scores; their text is erased and erased_at is stamped. deleted is false when no trace has that id. Every deletion is audited at iris://audit. Full detail: iris://capabilities.

When not to use it. To expire data in bulk (retention.days). To change a trace: traces are immutable.

Returns. JSON: deleted, trace_id.

Errors. IRIS_STORAGE_ERROR. A malformed trace_id is refused. Failures return {"error":{code,message,recovery}} with isError; follow recovery.

Siblings. log_trace — store a trace; get_traces — find the trace to delete; delete_rule — the equivalent for custom rules.

Input Schema

NameRequiredDescriptionDefault
trace_idYesTrace id to delete (32-hex lowercase; obtained from log_trace response or get_traces)

Output Schema

NameRequiredDescriptionDefault
deletedYes
trace_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.1
    • removedOutput schema / properties / deleted / description
      Removed value: -"true when a trace row was removed; false when no trace with that id existed for this tenant"
    • removedOutput schema / properties / trace_id / description
      Removed value: -"the id that was asked for"
  2. Changed1 schema field changedv0.9.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "deleted": {
      +      "description": "true when a trace row was removed; false when no trace with that id existed for this tenant",
      +      "type": "boolean"
      +    },
      +    "trace_id": {
      +      "description": "the id that was asked for",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "deleted",
      +    "trace_id"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changedv0.8.0
    • addedInput schema / additionalProperties
      Added value: +false
  4. Changed1 schema field changedv0.4.6
    • removedInput schema / additionalProperties
      Removed value: -false
  5. Addedv0.1.10

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, but the description supplies far more than the boolean: linked evaluations keep verdicts/scores while text is erased and erased_at stamped, spans are removed, `deleted: false` for unknown ids, auditing at iris://audit, and named error codes with a recovery protocol. This is precisely the cascade/permanence context an agent needs before an irreversible write.

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?

Labeled sections (What it does / When not to use / Returns / Errors / Siblings) make it scannable and the destructive consequence is front-loaded in the opening line. Minor waste: a 'Returns' line restates what the existing output schema already declares, and the capabilities URL is filler for a single-parameter tool.

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, non-idempotent single-param tool with an output schema, the description covers cascade effects, partial erasure semantics, audit trail, error taxonomy, and recovery — leaving no material gap an agent would need to fill before calling it.

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?

Only one parameter and schema coverage is 100% — the schema already documents the 32-hex pattern and where to obtain the value. The description adds only the behavioral note that a malformed trace_id is refused, which is mildly useful but not additional semantic detail about the parameter itself. Baseline 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?

First sentence gives a specific verb and resource ('Remove one stored trace by id') plus the non-obvious cascade ('its spans go with it') and the partial effect on linked evaluations. It is immediately distinguishable from log_trace and get_traces, which are named later.

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?

Has an explicit 'When not to use it' section that redirects bulk expiry to retention.days and trace modification to the immutability constraint, and the Siblings block routes the agent to get_traces to find the id before deleting. Both when-to-use and when-not are covered.

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