Skip to main content
Glama

Edit an image

image_edit

Prepare images for printing in one call: trim scanner borders, split multi-photo scans, straighten, remove backgrounds, crop, resize, and enhance documents. Returns print-ready file paths.

Instructions

Clean up and prepare images in one call, no other software needed: trim scanner borders, split several photos/cards scanned together into separate files, straighten, remove background, crop, rotate, resize, upscale, denoise, sharpen, enhance a document scan, adjust colours, round corners. Ops run in order. Returns file paths to use with print or layout_page.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source": "<source>",
      "ops": "<ops>"
    },
    "name": "image_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
dpiNoWrite this resolution into the file metadata
opsYesOps (each item is {op, ...params}; defaults in brackets): trim {threshold=14, padding_px=6, background="auto"|"white"|"#rrggbb"} crop the uniform border (scanner glass), ignores dust; split {min_area_pct=2, padding_px=10, threshold=14, deskew=true} one file per object on a plain background; must be last; deskew {max_degrees=15} straighten a tilted page; remove_background {method="auto"|"color"|"ai", tolerance=24, feather=1.5} transparent PNG; crop {x,y,width,height}; rotate {degrees, fill="transparent"|"auto"|css colour}; flip {horizontal,vertical}; resize {width,height,scale,fit="inside"|"contain"|"cover"|"fill",kernel="lanczos3"}; denoise {strength=2 (1-5)}; sharpen {amount=1 (0-3)}; upscale {scale=2 (2-4)} (smooth enlarge, not AI); enhance_document {mode="color"|"gray"|"bw", strength=1}; adjust {brightness,contrast,saturation (-100..100), hue (deg), gamma (0.1-5)}; grayscale {}; invert {}; threshold {value=160}; round {radius_px | circle:true}; border {width_px, color="black"}; pad {top,right,bottom,left,color="transparent"}
formatNoDefault: png when transparency is produced, else the source format
sourceYesLocal image path (png, jpg, webp, tif, gif, bmp, svg) or a data: URI
qualityNoJPEG/WebP quality, default 92
overwriteNoAllow output_file to replace an existing file
output_dirNoFolder for the results. Default: the print-mcp images folder (files older than 7 days are removed there)
output_fileNoExact output path ending .png, .jpg, .jpeg or .webp. Never overwrites unless overwrite is true. With split, a -1, -2 suffix is added

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=false, so the write nature is known. The description adds real behavioural context beyond that: operations execute sequentially, ordering constrains what is possible (split must be last), and the return value is file paths rather than an inline image. It does not cover failure modes (bad path, unsupported op) or how the source file is treated, which keeps it from a 5.

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?

Front-loaded with the purpose in the first clause, followed by the capability list and two short closing sentences about ordering and return values. The long middle enumeration largely duplicates the ops schema, so it is not maximally tight, but every sentence still conveys usable information and nothing is padded.

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 tool with 8 parameters and a nested, polymorphic ops array, the description covers purpose, sequencing, and output destination, and the schema fills in all per-op detail. Missing only edge-case behaviour (what happens on invalid ops or unwritable paths) and any note that output lands in a folder with 7-day retention, which appears only in the schema.

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?

Schema description coverage is 100% and the ops array documents every op with its parameter names, defaults and ranges, so the description is not required to carry parameter detail. The prose lists the same operations in natural language but adds no syntax, constraints or defaults of its own. Baseline 3 is appropriate when the schema does all the semantic work.

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?

States a specific verb (edit/clean up and prepare) and resource (images), then enumerates the concrete transformations available (trim, split, deskew, remove background, crop, rotate, resize, upscale, denoise, sharpen, enhance document, adjust colours, round corners). It also names the downstream siblings ('print or layout_page') whose inputs these outputs feed, so an agent can place it in the pipeline without opening another 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?

Makes the use case explicit ('clean up and prepare images in one call, no other software needed') and adds a sequencing rule ('Ops run in order', split 'must be last'). It also routes results onward to print/layout_page. It stops short of saying when NOT to use it (e.g. vs. scan or preview) or which op combination suits which scenario.

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