Skip to main content
Glama

crop

Extract a rectangular sub-region from an image and save it as a new file, leaving the original untouched. Input coordinates are automatically clamped to image bounds.

Instructions

Extract a rectangular sub-region and write it to a NEW file (source unchanged). The region is defined by its top-left corner (x, y) and size (width, height); coordinates are automatically clamped to the image bounds, so partial/out-of-bounds boxes are safe. Returns the output path and the actual box used.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesLeft edge of the crop region, in pixels (clamped to image bounds).
yYesTop edge of the crop region, in pixels (clamped to image bounds).
outYesOutput image path. A new file is created; the source is left untouched.
pathYesSource image path.
widthYesWidth of the crop region, in pixels.
heightYesHeight of the crop region, in pixels.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explicitly states that the source is unchanged, that coordinates are automatically clamped, and that the return value includes the output path and actual box. This is thorough for a crop operation. It does not cover edge cases like invalid image files or zero dimensions, but those are minor given the safe clamping behavior and typical tool expectations.

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?

Two sentences with no waste. The purpose and non-destructive nature are front-loaded, followed by the coordinate semantics and a safety note. Every sentence adds essential information; there is no filler.

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?

The description is complete for a 6-parameter tool with no output schema and no annotations. It covers the operation, parameters, edge-case handling (clamping), and return value. An agent has everything needed to invoke the tool correctly without additional lookup.

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 baseline is 3. The description adds value beyond the schema by explaining that x,y define the top-left corner, width/height define size, and that clamping applies. It also specifies the return value (output path and actual box), which is not in the schema. This extra context justifies a score above baseline.

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 ('Extract a rectangular sub-region and write it to a NEW file'), immediately distinguishing it from sibling tools like resize, rotate, or compress. It also highlights the non-destructive behavior, which is the key differentiator from in-place editing tools. The phrasing is unambiguous and precisely identifies what the tool does.

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 clearly implies when to use the tool (when you need a rectangular sub-region) and provides a safety hint via clamping behavior. However, it does not explicitly name alternatives or give exclusion criteria (e.g., 'use resize instead to scale the whole image'). The context is clear but lacks direct routing to siblings, so it earns a 4 rather than a 5.

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