Skip to main content
Glama

图片裁剪

image_crop
Idempotent

Crops a specified rectangular region from an image using pixel or normalized coordinates, returning the cropped sub-image as base64 PNG.

Instructions

裁剪图片的指定区域,返回裁剪后的子图。

参数:

  • image: 图片路径或URL

  • left: 裁剪区域左上角x坐标

  • top: 裁剪区域左上角y坐标

  • width: 裁剪区域宽度

  • height: 裁剪区域高度

  • normalized: 坐标是否为0-1归一化值(默认false,像素坐标)

  • output_path: 可选,保存到文件路径

返回:裁剪后的图片(base64 PNG)和元信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topYes裁剪区域左上角y坐标
leftYes裁剪区域左上角x坐标
imageYes图片路径或URL(http/https开头为URL,否则为本地路径)
widthYes裁剪区域宽度(像素坐标时≥1,归一化坐标时0-1之间)
heightYes裁剪区域高度(像素坐标时≥1,归一化坐标时0-1之间)
normalizedNo坐标是否为0-1归一化值。false表示像素坐标,true表示归一化坐标。
output_pathNo可选:输出图片保存的文件路径。无论是否设置,图片都会以base64返回。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthYes
formatYes
heightYes
size_bytesYes
Behavior4/5

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

Annotations already indicate idempotentHint=true and destructiveHint=false; the description adds useful behavioral context by stating the return value is a base64 PNG plus metadata and that output_path optionally saves to a file. It does not contradict the annotations. It stops short of disclosing overwrite behavior for existing output files, but the annotation coverage lowers the burden.

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?

The description is well structured: a one-sentence purpose, a compact parameter list, and a return-value summary. Every line carries necessary information for a 7-parameter tool, and nothing is redundant or 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?

Given the presence of a complete input schema, an output schema, and annotations, the description is sufficiently complete: it covers input sources, coordinate options, optional file output, and return format. It could have mentioned out-of-bounds behavior or coordinate validation details, but these are not essential for correct invocation.

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 the schema already documents every parameter, including defaults and constraints such as normalized behavior and width/height bounds. The description's parameter list largely restates this information without adding meaningful new semantics for the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific action and resource: '裁剪图片的指定区域,返回裁剪后的子图' (crop a specified region of an image and return the cropped subimage). This clearly distinguishes it from siblings like resize, rotate, flip, and concat, though it does not explicitly name any alternative.

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?

Usage is reasonably implied by the tool name and the phrase '裁剪图片的指定区域' — an agent can infer it should be used when a sub-region of an image is needed. However, the description gives no explicit when-to-use guidance, no exclusions, and no pointers to alternative tools such as image_resize or image_rotate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/karond-is-me/vision-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server