Skip to main content
Glama

图片缩放

image_resize
Idempotent

Resize images to exact dimensions or by scale factor. Supports cover, contain, fill, inside, and outside fit modes, returning the resized image as base64 PNG.

Instructions

缩放图片到指定尺寸。

支持三种模式:

  1. 指定width和/或height(保持宽高比,fit模式可选)

  2. 指定scale(按比例缩放,如0.5为缩小一半,2.0为放大一倍)

参数:

  • image: 图片路径或URL

  • width: 目标宽度(像素)

  • height: 目标高度(像素)

  • scale: 缩放比例(0.01-10.0)

  • fit: 缩放模式(cover/contain/fill/inside/outside),默认inside

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

返回:缩放后的图片(base64 PNG)和元信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fitNo缩放模式inside
imageYes图片路径或URL(http/https开头为URL,否则为本地路径)
scaleNo缩放比例
widthNo目标宽度(像素)
heightNo目标高度(像素)
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?

注解已声明非只读、幂等、非破坏性;描述在此基础上补充了关键行为:支持两种尺寸指定方式、fit模式、返回base64 PNG、output_path可选但总会返回。未说明对URL的下载/格式错误处理,但整体透明性高于最低要求。

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?

开头一句话点明用途,随后用两种模式+参数列表+返回值的紧凑结构呈现,每部分都有信息量,没有冗长背景或重复误导。参数表的补充说明使描述自洽。

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?

对于6参数、1枚举、有输出schema的工具,描述覆盖了所有参数、模式和返回格式,足够完整;主要缺口是width/height与scale同时提供时的优先级/报错规则,以及文件写入的覆盖行为,但这类边界信息可由schema约束推断。

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覆盖率为100%,基线为3;描述额外赋予了实际语义:scale举例(0.5缩小一半)、width/height可只传一个并保持宽高比、output_path设置后仍返回base64。这些超过schema字段本身的信息帮助agent正确构造参数。

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?

描述以明确的动词和资源开头:“缩放图片到指定尺寸”,并列出三种操作模式,清楚表明这是图像缩放工具。结合兄弟工具(crop/rotate/flip等),它足够独特,agent可无歧义地选择。

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?

描述提供了何时进行缩放的清晰上下文(指定width/height或scale),但没有明确说明何时不应使用、参数冲突如何解决,或与crop/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