Skip to main content
Glama
iftahs
by iftahs

auto_crop

auto_crop
Destructive

Trim registration edges by detecting rows and columns with excessive zero pixels, then crop them with optional padding. Use dry-run to preview crop rectangle before applying.

Instructions

Trim registration edges: finds rows/columns with > max_zero_fraction zero pixels and crops them (+pad). dry_run reports the rect only. Checkpoints first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
padNo
dry_runNo
thresholdNo
checkpointNoWrite an .xisf checkpoint before running (default true)
max_zero_fractionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already mark destructiveHint=true, and the description adds useful behavioral detail beyond that: dry_run only reports the rect, while a real run crops and is preceded by a checkpoint. This is meaningful disclosure for a mutating tool.

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 short and front-loaded: the algorithm comes first, then dry_run behavior, then checkpointing. The fragment 'Checkpoints first' is slightly ambiguous but still compact and useful.

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

Completeness3/5

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

For a destructive 6-parameter tool with no output schema, the description covers the main behavior and dry-run semantics but misses threshold and id. It also does not say what a non-dry-run call returns or how the crop is applied to the image.

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?

With only 17% schema description coverage, the description does much of the work, explaining max_zero_fraction, pad, dry_run, and checkpoint. However, it omits threshold entirely and does not clarify id, leaving two parameters effectively unexplained.

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 names a specific operation (trim registration edges) and explains the exact criterion: rows/columns with > max_zero_fraction zero pixels are cropped with padding. This clearly distinguishes auto_crop from generic siblings like crop and crop_preview.

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?

The description gives clear context for when the tool applies: trimming registration edges. It also advises using dry_run to preview the rect and checkpointing first. However, it does not explicitly contrast with crop or other crop-like siblings.

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