Skip to main content
Glama

Sweep scratch leftovers (loop hygiene)

cleanup_scratch
DestructiveIdempotent

Identify disposable records flagged as scratch or temporary, then optionally delete only safe, unreferenced candidates. Runs a dry-run report by default; set confirm=true to remove them through a gated, versioned delete path.

Instructions

Find records that scratch conventions mark as disposable — a name starting 'TMP ·', a 'scratch'/'tmp' tag, or '(delete me)' in the name; optionally '(diagnostic)' records and unnamed ones. DRY-RUN BY DEFAULT: reports every match, why it matched, and what (if anything) references it. confirm=true deletes only the safe candidates — unreferenced, not recently touched — through the same gated delete path as delete_resource. Content deletes are VC-recorded (restorable); db_modification deletes are NOT restorable and only ever match the explicit TMP/scratch markers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindsNoKinds to sweep (default: query, block, db_modification).
confirmNotrue = delete the safe candidates. Omit for the dry-run report.
max_deleteNoCap deletions per run (default 50); the remainder is reported.
include_unnamedNoAlso flag null/empty-named records — content kinds only, never db_modifications. Default false.
older_than_minutesNoOnly records untouched this long are candidates — a running loop may still need newer ones (default 60; 0 disables).
include_diagnosticsNoAlso flag '(diagnostic)'-suffixed records (e.g. 'SYS · Block Inspect (diagnostic)'). Default false.
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the description doesn't need to restate that this can delete. However, it adds valuable context beyond annotations: the dry-run default, the distinction between VC-recorded (restorable) content deletes and non-restorable db_modification deletes, and the safety criteria (unreferenced, not recently touched). This is rich behavioral disclosure that goes beyond what annotations provide. The only minor gap is not explicitly stating that the tool is idempotent (though annotations declare idempotentHint=true), but the description's detail on safety and restorability is strong.

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 well-structured. It front-loads the matching criteria and the dry-run default, then explains the deletion behavior and restorability. Every sentence adds meaningful information — no filler. The use of em-dashes and parentheticals packs a lot of detail without becoming unwieldy. It's appropriately sized for a tool with 6 parameters and complex safety semantics.

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 tool with 6 parameters, no output schema, and destructive potential, the description is remarkably complete. It covers what matches, what gets deleted, safety criteria, restorability, and defaults. The only thing an agent might want is an example output format for the dry-run report, but the description already explains what the report contains (every match, why it matched, what references it). Given the complexity and the annotations covering safety, this is complete enough for correct invocation.

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 description coverage is 100%, so the schema already documents all 6 parameters. The description adds value by explaining the default behavior (kinds default to query/block/db_modification, max_delete default 50, older_than_minutes default 60) and the safety semantics (older_than_minutes protects running loops, include_unnamed never applies to db_modifications). This goes beyond the schema's basic descriptions, providing operational context that helps an agent choose correct parameter values.

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 clearly states the tool's purpose: finding and optionally deleting records that scratch conventions mark as disposable. It specifies the matching criteria (name starting 'TMP ·', 'scratch'/'tmp' tag, '(delete me)' in name) and distinguishes it from the general delete_resource sibling by emphasizing the dry-run default and the gated delete path. This is a specific verb+resource with clear scope.

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 (for cleaning up scratch leftovers) and contrasts it with delete_resource, noting that deletions go through the same gated path. It also explains the dry-run default and the confirm=true flag for actual deletion, giving clear guidance on when to use the tool versus alternatives. The mention of 'loop hygiene' in the title further clarifies the intended use case.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zuarbase/Zuar-Portal-MCP-Public'

If you have feedback or need assistance with the MCP directory API, please join our Discord server