Skip to main content
Glama

worktree_gc

Destructive

Reclaim rebuildable build-cache entries project-wide or across all repos. Runs a dry-run report by default and quarantines deletions for reversible cleanup.

Instructions

Reclaim rebuildable build-cache entries (project-wise or --all). Default is a dry-run report. Mutations require confirm=true; deletions are quarantine-only (reversible via undo). Filters: tool, older_than, newer_than, min_size, max_size, tier, include, exclude, keep_latest, project, all, undo, journal_id, purge.

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": "worktree_gc"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoScan all repos, not just this one
jsonNoReturn JSON instead of text
tierNoCandidate tier (default both)
toolNoRestrict to these tools (e.g. pnpm, cargo)
undoNoPreview restoring a quarantine journal id; confirm=true restores it, reversing an apply
purgeNoPermanently delete quarantined entries older than 14d (requires confirm=true)
confirmNotrue applies/quarantines/restores/purges; false or omitted is a dry-run report
excludeNoGlob patterns to exclude
includeNoGlob patterns to include
projectNoVault project slug to scope to
max_sizeNoOnly entries at most this size (e.g. 2G)
min_sizeNoOnly entries at least this size (e.g. 1M)
worktreeNoWorktree path to scope to (default: cwd)
journal_idNoRestrict purge to this quarantine journal id; must be a nonempty safe id
newer_thanNoOnly entries newer than this (e.g. 7d)
older_thanNoOnly entries older than this (e.g. 30d, 12h, 2w)
keep_latestNoAlways keep the N newest entries per tool
workspace_pathNoAbsolute thread workspace directory; must map to this project. Omit only when the server cwd is the thread workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.15.1
    • changedInput schema / properties / confirm / description
      Previous value: -"true applies/quarantines/purges; false or omitted is a dry-run report"New value: +"true applies/quarantines/restores/purges; false or omitted is a dry-run report"
    • addedInput schema / properties / journal_id
      Added value: +{
      +  "description": "Restrict purge to this quarantine journal id; must be a nonempty safe id",
      +  "minLength": 1,
      +  "pattern": "^[0-9A-Za-z][0-9A-Za-z._:-]*$(?![\\s\\S])",
      +  "type": "string"
      +}
    • changedInput schema / properties / undo / description
      Previous value: -"Restore a quarantine journal id, reversing an apply"New value: +"Preview restoring a quarantine journal id; confirm=true restores it, reversing an apply"
  2. Addedv0.13.0

TDQS

A3.8/5.0
Behavior5/5

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

Annotations only mark this as destructive and non-idempotent; the description goes well beyond them by disclosing that the default is a non-mutating dry-run, that mutations require confirm=true, that deletions are quarantine-only and reversible via undo, and that purge permanently deletes entries older than 14d. This is exactly the safety and reversibility context an agent needs before invoking a destructive tool, and it is consistent with destructiveHint=true.

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

Conciseness3/5

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

The first three sentences are well front-loaded with purpose, default behavior, and the safety gate. The trailing 'Filters: ...' sentence is a 14-item comma list that largely duplicates parameters already documented at 100% coverage, so it does not fully earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 18-parameter tool with no output schema and destructive annotations, the description covers the critical unknowns: dry-run default, confirm gating, quarantine reversibility, and permanent purge semantics. The remaining parameter detail is fully carried by the schema, so the description is nearly complete for correct invocation.

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 description coverage is 100%, so the schema already documents all 18 parameters including their formats and the undo/confirm/purge interplay. The description re-lists the filter names as a run-on enumeration but adds no syntax or semantics beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Reclaim rebuildable build-cache entries,' and specifies the scope options (project-wise or --all). An agent immediately knows this is a cache-reclamation tool. It does not, however, differentiate itself from potentially overlapping siblings like prune or hygiene_report.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description establishes the operational default ('Default is a dry-run report') and the gate for mutations ('require confirm=true'), which implies usage. But it never states when to choose this tool over adjacent ones such as prune, worktree_audit, or hygiene_report, leaving alternative selection to inference.

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