Skip to main content
Glama

image_resize

Batch resize images from a file or folder into a chosen output directory using long-side, exact width/height, fixed-width, or percentage scaling.

Instructions

批量调整图片尺寸。input_path 可为单文件或目录;输出到 output_dir。四选一:long_side(按长边等比缩,只缩不放)、width+height(精确)、width(定宽等比)、percent(百分比,如 50 表示缩到一半)。返回处理张数与输出目录。

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": {
      "input_path": "<input_path>",
      "output_dir": "<output_dir>"
    },
    "name": "image_resize"
  }
}

Input Schema

NameRequiredDescriptionDefault
widthNo
heightNo
percentNo
long_sideNo
input_pathYes
output_dirYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose that input may be a file or directory, that output goes to output_dir, that long_side only shrinks, and that the return is a count plus output directory — but it says nothing about output file naming, overwrite behavior, whether output_dir must pre-exist, or what happens to failed files in a batch.

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?

It is a single tight paragraph with no filler: scope, output location, the four mutually exclusive modes, and the return value, in that order. Every clause carries information an agent needs.

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

Completeness3/5

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

For a batch mutation tool with no annotations and no output schema, the description is reasonably complete on inputs and the return shape. It still leaves the operational side underspecified — overwrite policy, output naming, and batch failure handling — which matters when writing into an output directory.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate for all six parameters — and it does. Every parameter is given meaning: input_path (file or directory), output_dir, long_side (proportional on the long edge, shrink-only), width+height (exact), width alone (fixed-width proportional), and percent with a concrete example (50 = half).

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 verb and resource, '批量调整图片尺寸' (batch resize images), and immediately scopes the input as a single file or directory. It is clearly distinguishable from siblings such as image_compress or image_convert by the explicit resize modes, though it never names an alternative to route against.

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?

'四选一' (choose exactly one of four) gives explicit mode-selection guidance, and each mode states its own semantics, e.g. long_side only shrinks and never enlarges. What is missing is when to pick this tool over image_compress or image_convert, so the guidance is clear about how to call it but not about when not to.

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