Skip to main content
Glama

Resize image

resize_image

Resize PNG, JPEG, WebP, or AVIF images by width, height, or scale. Write the resized image to a new file next to the original or to a specified output path.

Instructions

Resize a PNG, JPEG, WebP, or AVIF image with Tinify.dev by width, height, or scale, and write the result next to the original (or to output_path). At least one of width, height, or scale is required. The source image is never overwritten silently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the image (png, jpg, jpeg, webp, avif; max 40 MB).
scaleNoScale factor, e.g. 0.5 halves both dimensions.
widthNoTarget width in pixels.
heightNoTarget height in pixels.
overwriteNoAllow replacing an existing file at the output path. Default false.
output_pathNoAbsolute path to write the result. Default: <name>.min.<ext> next to the input. The source image is never overwritten unless output_path points at it AND overwrite is true.
keep_aspect_ratioNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthYes
wroteYesWhether a file was written.
heightYes
optimizedYesfalse when the API could not shrink the file and returned the original bytes; null when the concept does not apply (resize/crop).
request_idYesQuote this when contacting support.
output_pathYesWhere the result was written, or null when nothing was written.
saved_bytesYesoriginal_bytes - result_bytes.
result_bytesYesResult size in bytes.
change_percentYesByte change in percent; negative means smaller.
original_bytesYesInput size in bytes.
Behavior4/5

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

Beyond annotations (readOnlyHint=false, destructiveHint=false), the description adds important safety context: the source image is never overwritten silently, and details output path behavior. This clarifies mutation safety.

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 two sentences, front-loaded with the main purpose, and includes critical constraints without unnecessary words.

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?

With 7 parameters, high schema coverage, and an output schema (not shown), the description adequately covers output path defaults and safety. It is sufficient for an agent to understand the tool's behavior.

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 86%, so parameters are well-documented. The description adds minor value by reinforcing the requirement for at least one of width/height/scale and the overwrite behavior, but does not significantly deepen parameter understanding.

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?

The description clearly states the tool resizes images (PNG, JPEG, WebP, AVIF) using Tinify.dev by width, height, or scale, and specifies output behavior. It differentiates from sibling tools like compress_image and crop_image.

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?

The description provides clear context on when to use the tool (resizing images) but does not explicitly exclude scenarios or mention alternatives. It states the requirement for at least one dimension parameter.

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/Stianlars1/tinify-mcp'

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