Skip to main content
Glama

List cleanup candidates

cleanup_list
Destructive

Scans a finished part for cleanup candidates such as loose bodies, spurs, bumps, uneven struts and flat webs, then writes a marks file and report for later judged application.

Instructions

List the geometric cleanup candidates of a finished part as a marks file, in a NEW folder: facts and options, no edit, no verdict.

CONTRACTS.md section 29.3. The tool scans result/final.stl with the detectors of the pipeline stage s7_cleanup and writes marks.json (format 1, mm: apply_marks, the Refine page and the marks: source of ratchet_run read it) and cleanup.json (the full report). It lists loose bodies (no fixed and no load voxel), dead-end spurs, thin bumps, uneven struts (SMOOTH) and flat webs (FAIR). When a loose body exists the file holds the bodies only: judge them, then list the acc_01 of that ratchet root for the features. The list judges nothing: ratchet_run(marks=marks_rel) applies each mark and judges it with the rules of the YAML. The run folder and every input stay as they are. Time: about 2 s on the short hook and 8 s on the ladle. The call runs in the server and finishes if the client stops waiting (Codex waits 60 s for a tool by default); then read cleanup.json, or call again with overwrite=true. A grid above max_voxels or the memory limit gives the facts and the options (pitch_mm, max_gb), not a crash. A wrong input gives {"ok": false, "error": ...}. run_dir: a finished run, or an acc_NN folder of a ratchet root (needs run.json, labels.bin, result/final.stl). Default: the last run of this server. out_dir: the new folder. Default: -cleanup beside the run folder (beside the root for an acc_NN folder). Refused, with the reason and the options: a run folder or a folder inside one, a ratchet root or a folder inside one, a folder with an input file, a symbolic link, a folder with files that is not an earlier cleanup folder. estimate_only: the memory and time estimate of the detector and the judge; no search, no file. options: pitch_mm (0.5), max_candidates (10; null lists all), kinds (body, spur, bump, member), order ("pipeline" or "stress"), max_voxels, max_gb, and the limits of the detectors (spur_*, bump_*, member_*, mild_*, web_flatness, opening_radius_mm, frozen_near_mm, frozen_max_share, near_frozen_mm); cleanup.json gives each default and its source line in the pipeline. The constants of the method are not settable. overwrite: write again into an earlier cleanup folder. detail: the full report in the reply. yaml_path: the YAML of the run when run.json names a file that is not there. root: a ratchet root; its log gives the measured judge time for the estimate. Each mark has the detector, the location, the operator, the thresholds used, the measured sizes and, when verify/fields.npz is there, the stress near it. The facts also say how well the detectors fit this part (applicability). Reply keys: ok, counts, candidates (id, type, operator, detector, confidence, centre_mm, detected_volume_mm3, length_mm, nearest_frozen_mm, stress_ratio, mirror), applicability, bodies, estimate, routes, problems, notes, out_dir_rel, marks_rel, report_rel.

Input Schema

NameRequiredDescriptionDefault
rootNo
detailNo
optionsNo
out_dirNo
run_dirNo
overwriteNo
yaml_pathNo
estimate_onlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only flag destructive=non-idempotent write; the description adds a great deal more: it writes marks.json and cleanup.json into a brand-new folder, never touches the run folder or inputs, and refuses existing/ratchet-root/symlink/non-cleanup folders with the reason and options. It also discloses runtime (~2 s / 8 s), that the call completes server-side even if the client stops waiting (Codex 60 s), recovery via cleanup.json or overwrite=true, the memory/voxel-limit fallback instead of a crash, and the error envelope {'ok': false, 'error': ...}.

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 purpose and the safety-critical refusal rules are front-loaded, and nearly every line carries real information (defaults, reply keys, recovery paths). But the body is a wall of telegraphic fragments and parentheticals ('CONTRACTS.md section 29.3', 'the marks: source of ratchet_run read it'), with no headings or grouping, so parameter facts, detector lists and failure modes interleave and are hard to scan.

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?

There is no output schema, yet the description enumerates the reply keys (ok, counts, candidates with their fields, applicability, bodies, estimate, routes, problems, notes, out_dir_rel, marks_rel, report_rel) and the error shape. For a destructive, write-producing tool with 8 undocumented parameters, it covers everything an agent needs to call it safely and interpret the result.

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 must carry all semantics — and it does, documenting every one of the 8 parameters: run_dir and its default (last run of this server), out_dir and its default plus the refusal cases, estimate_only, overwrite, detail, yaml_path, root, and the full options set with defaults (pitch_mm 0.5, max_candidates 10/null, kinds, order, max_voxels, max_gb, spur_*/bump_*/member_*/mild_*, web_flatness, opening_radius_mm, frozen_*). It even notes which constants are not settable.

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 opening sentence gives a specific verb, resource and artefact: list geometric cleanup candidates of a finished part as a marks file in a NEW folder. It explicitly separates itself from siblings by stating 'The list judges nothing: ratchet_run(marks=marks_rel) applies each mark and judges it' and by naming the marks format consumed by apply_marks/the Refine page. An agent can tell this apart from ratchet_run and apply_marks without opening any schema.

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

Usage Guidelines4/5

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

It states the precondition (a finished run needing run.json, labels.bin, result/final.stl), the branch where a loose body exists ('judge them, then list the acc_01 of that ratchet root'), the follow-up tool (ratchet_run with marks_rel), and a cheap pre-flight mode (estimate_only: no search, no file). What it lacks is a crisp 'do not call this when…' list, and the guidance is embedded in dense prose rather than stated as routing rules.

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