Skip to main content
Glama

Delete old captures

prune_captures
Destructive

Prunes old captures, deleting all but the newest keep files to prevent the save directory from growing without bound.

Instructions

Delete all but the newest keep captures, and say which went.

Captures accumulated forever. shot writes one per call and nothing ever removed them, so an agent photographing in a loop grew the SAVE DIRECTORY without bound — the folder holding the worlds and characters, which is not a cache and not somewhere to leave litter.

Args: keep: How many of the newest captures to keep. REQUIRED and deliberately without a default, the same way shot requires a region: this deletes files, and a destructive tool that runs with no arguments is one that gets called by accident. keep=0 removes all of them, which is a real request and has to be spelled out.

Only files matching THIS mod's capture pattern are touched, and each is re-checked to resolve to a direct child of the save directory — the same containment read_capture uses, because a delete that listed and removed through different rules would be looser than the read beside it. The whole set is validated before anything is unlinked, so a refusal costs nothing rather than leaving a half-finished prune.

Newest is decided by MTIME, not by the index in the filename: the index is this harness's counter and the timestamp is the disk's account of what happened.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keepYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
removedYes
remainingYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.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 the description goes well beyond that: it explains the `keep` parameter is required to prevent accidental deletion, that `keep=0` removes all captures, that only files matching this mod's capture pattern are touched, that each file is re-checked for containment, that the whole set is validated before any unlink (so a refusal costs nothing), and that newest is determined by MTIME not filename index. This is rich behavioral disclosure that adds significant value beyond the annotations.

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 well-structured and front-loaded with the core action. It uses paragraphs to explain rationale, safety, and edge cases. It is somewhat long, but every sentence earns its place by explaining a non-obvious behavior or safety property. The only minor deduction is that some rationale could be tightened without losing meaning.

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 tool with one required parameter, the description covers everything an agent needs: what gets deleted, how the keep count works, what happens with keep=0, the containment check, the validation-before-delete behavior, and the MTIME ordering. The output schema exists, so return values need not be described. This is complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden. It explains `keep` in detail: it is required, deliberately has no default, `keep=0` is a real request that removes all captures, and it is compared against MTIME to decide which captures survive. This fully compensates for the schema's lack of description.

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: 'Delete all but the newest `keep` captures, and say which went.' It clearly distinguishes this from siblings like `shot` (which creates captures) and `read_capture` (which reads them). The purpose is unambiguous and immediately actionable.

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?

The description explicitly explains when to use this tool: when captures have accumulated and need pruning. It contrasts with `shot` (which writes captures) and `read_capture` (which reads them), and explains the containment rule is the same as `read_capture`. It also warns against accidental destructive calls, making the usage context very clear.

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