Skip to main content
Glama

tokmeter_cleanup_execute

Destructive

Permanently deletes session data matching project, provider, or date filters after a required preview receipt and DELETE confirmation, creating a restorable tar.gz backup first.

Instructions

DESTRUCTIVE: Permanently delete session data matching the given filters. Disabled by default; the machine owner must explicitly enable destructive MCP tools. Always creates a tar.gz backup before deleting (restorable with tokmeter_restore). Requires at least one filter — a project, providers, or a date range (since/until or a today/week/month scope); an empty filter is refused because it would delete every session. ALWAYS call tokmeter_cleanup_preview first and pass its one-time receipt with the same filters. Requires confirm='DELETE' as an additional safety guard.

Input Schema

NameRequiredDescriptionDefault
scopeNoTime scope: today, week (last 7d), month (calendar month), or all (default)
sinceNoStart date (YYYY-MM-DD) for custom date range
untilNoEnd date (YYYY-MM-DD) for custom date range
backupNoAccepted for compatibility only: over MCP a tar.gz backup is always created before deleting, even when false
confirmYesMust be exactly 'DELETE' to proceed with deletion
projectNoFilter by project name/path substring
providersNoFilter to specific providers (e.g. ['claude-code','cursor'])
preview_idNoOne-time receipt returned by tokmeter_cleanup_preview for these exact filters

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.19.3

TDQS

A4.9/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 adds critical behavior beyond them: a tar.gz backup is always created before deletion and is restorable with tokmeter_restore, the tool is disabled by default, an empty filter is refused, and a one-time preview receipt is required. These are exactly the safety and side-effect details 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?

The description is dense but front-loaded and every sentence earns its place: destruction warning, default-disabled status, backup behavior, restore path, filter requirement, preview receipt requirement, and confirmation guard. There is no filler, and the safety-critical information appears first.

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?

With no output schema, the description carries the full burden and does so completely: it covers destructive impact, backup and restore behavior, prerequisite preview flow, filter requirements, confirmation guard, and disabled-by-default state. An agent has everything needed to invoke this tool correctly and safely.

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 would be 3, but the description adds meaningful constraint semantics beyond the schema: at least one of project, providers, date range, or scope must be supplied, and the preview receipt must correspond to the same filters. It also reinforces confirm='DELETE' as a safety guard, though it does not need to restate individual parameter formats already covered by the schema.

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 opens with a specific verb and resource: 'Permanently delete session data matching the given filters.' It immediately distinguishes this destructive execute tool from its preview and restore siblings, so an agent knows exactly what this does without opening the schema.

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 and when-not-to-use guidance: always call tokmeter_cleanup_preview first and pass its one-time receipt, require at least one filter, and use confirm='DELETE'. It also names the restore path for recovery and states that the tool is disabled unless the machine owner enables destructive MCP tools.

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