Skip to main content
Glama

Image Crop API - crop to ratio, box or trim borders

image_crop
Read-onlyIdempotent

Crop images to a ratio (1:1, 4:5, 16:9, 9:16, 3:2), to a pixel box, or trim uniform borders automatically. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.002/call via x402 at https://radarbg.com/x402/image-crop.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mode": "ratio",
      "ratio": "1:1",
      "fileName": "sample.png",
      "fileContent": "iVBORw0KGgoAAAANSUhEUgAAAHgAAABQCAIAAABd+SbeAAAA6klEQVR4nO3cQQ2DABAAwdKgg1cFVQIykIOEyqiIisFDKdsQZv6XXDb3vmFa3jeOd//3AlchdEToiNARoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6Mi4Z/jznH+0xmk8Xut3gy46InRE6IjQEaEjQkeEjggdEToidEToiNARoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjggdEToidEToiNARoSNCR4SOCB0ZPIFtuOiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjggdEToidEToiNCRDexBBl0OjJSaAAAAAElFTkSuQmCC"
    },
    "name": "image_crop"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoLeft px (mode=box)
yNoTop px (mode=box)
modeNoratio, box or trimratio
filesNoOr several files: [{fileName, fileContent (base64)}]
ratioNoRatio for mode=ratio1:1
widthNoWidth px (mode=box)
heightNoHeight px (mode=box)
fileNameNoFile name with extension, e.g. report.pdf
fileContentNoThe file as base64 (a data: URI is fine)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / height / minimum
      Added value: +0
    • addedInput schema / properties / width / minimum
      Added value: +0
    • addedInput schema / properties / x / minimum
      Added value: +0
    • addedInput schema / properties / y / minimum
      Added value: +0
  2. Added

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent/openWorld annotations by disclosing that processing is server-side, that files are deleted immediately and nothing is retained, and by spelling out the free-tier limit (5 calls/day per IP) and both paid authentication paths. These are exactly the operational facts an agent needs before sending user image data.

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?

Three sentences with the capability stated first, followed by privacy then cost/auth. The pricing URL and marketing framing are slightly expendable, but every sentence is functionally distinct.

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?

No output schema exists, and the description never says what a successful crop returns (raw base64, a data URI, or a link), which is the one missing piece for a 9-parameter tool. Everything else — modes, privacy, cost, auth — is covered.

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%, so parameters like x/y/width/height already carry mode scoping notes, and the description only restates the ratio values that duplicate the enum. No additional meaning is added about how mode interacts with the file vs files parameters.

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 and resource ("Crop images") and enumerates all three operating modes — ratio with explicit values, pixel box, and automatic border trim — which map directly onto the mode enum. An agent can distinguish this from image_resize or pdftoppm-style siblings without opening the schema.

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

Usage Guidelines3/5

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

Mode selection is implied by the enumerated use cases (ratio for aspect fixes, box for precise regions, trim for borders), and the auth/pricing sentence clarifies access paths. However, it never states when to prefer this over image_resize or social_image_resizer, nor when not to use it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources