tokmeter_cleanup_execute
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
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | Time scope: today, week (last 7d), month (calendar month), or all (default) | |
| since | No | Start date (YYYY-MM-DD) for custom date range | |
| until | No | End date (YYYY-MM-DD) for custom date range | |
| backup | No | Accepted for compatibility only: over MCP a tar.gz backup is always created before deleting, even when false | |
| confirm | Yes | Must be exactly 'DELETE' to proceed with deletion | |
| project | No | Filter by project name/path substring | |
| providers | No | Filter to specific providers (e.g. ['claude-code','cursor']) | |
| preview_id | No | One-time receipt returned by tokmeter_cleanup_preview for these exact filters |