Skip to main content
Glama

resize

Resize an image to new dimensions and save as a new file, leaving the original untouched. Specify width, height, or both; choose contain, cover, fill, or stretch to control the fit.

Instructions

Resize an image and write the result to a NEW file (the source is never overwritten). Provide width and/or height; if only one is given the other is computed to preserve aspect ratio. 'fit' controls how the image maps into the target box: contain fits inside (no crop), cover fills the box and crops the overflow, fill/stretch forces the exact width x height (aspect ratio may change). Returns the output path and resulting dimensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fitNoMapping mode: contain (fit inside, keep ratio), cover (fill box, crop overflow), fill/stretch (exact size, ratio may change). Default contain.
outYesOutput image path. A new file is created; the source is left untouched.
pathYesSource image path.
widthNoTarget width in pixels. Omit to derive from height and preserve aspect ratio.
heightNoTarget height in pixels. Omit to derive from width and preserve aspect ratio.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations and no output schema, the description carries the full burden of behavioral disclosure. It explicitly states that the source is never overwritten, explains aspect ratio computation, details each fit mode's consequences (crop, aspect ratio change), and mentions the return value (output path and dimensions). This is comprehensive for a resize operation.

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 dense, relevant information. The key side effect (new file) is front-loaded, and the fit modes are explained efficiently. No wasted words or redundant phrasing.

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

Completeness4/5

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

For a straightforward resize tool with no output schema, the description covers the essential information: dimension specification, fit behavior, and the return value. It does not address edge cases like omitting both width and height, but that is a minor gap given the tool's simplicity.

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?

The schema covers all parameters with descriptions, so the baseline is 3. The description adds some clarity by explaining the interaction between width and height and elaborating on fit modes, but it largely repeats the schema content. It does not provide substantial new information beyond what the schema already documents.

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 action (resize an image), the resource (image), and the key side effect (writing to a new file, never overwriting the source). It distinguishes from siblings like crop or convert by specifying resizing behavior and preserving aspect ratio. No ambiguity in the tool's function.

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?

Provides explicit instructions on how to specify dimensions (width and/or height) with the aspect-ratio-preservation logic, and explains each fit mode's behavior. However, it does not mention when to prefer this tool over siblings like crop or thumbnail, so it lacks explicit alternative guidance.

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