Skip to main content
Glama

Convert image format

convert_image

Convert an image to AVIF, WebP, JPEG, or PNG with Tinify. Outputs a .min file beside the original unless a custom output path is provided.

Instructions

Convert an image to AVIF, WebP, JPEG, or PNG with Tinify.dev (beta endpoint; may not be enabled on every account yet). Writes .min. next to the original unless output_path is given. Converting to the same format is rejected by the API (same_format_conversion).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the image (png, jpg, jpeg, webp, avif; max 40 MB).
formatYesTarget format.
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.
quality_modeNo

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?

The description adds useful behavioral details beyond annotations: uses Tinify.dev, beta endpoint, file naming convention, and same-format rejection. However, it doesn't cover all traits like idempotency or rate limits.

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?

Two sentences, no fluff, front-loaded with key information. Every sentence adds value.

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?

Covers main purpose, side effects, and key constraint. However, it omits explanation of the quality_mode parameter, which is not described in the schema either. Output schema exists, reducing need to describe return values.

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 coverage is high (80%), so baseline is 3. The description adds context for output_path default behavior and same-format error, but does not explain the quality_mode parameter, leaving a gap.

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 converts images to specific formats (AVIF, WebP, JPEG, PNG) and distinguishes it from siblings like compress_image and resize_image by focusing on format conversion.

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?

The description implies use for format conversion but does not explicitly compare to alternatives or state when not to use it. It mentions beta status and same-format rejection, but lacks guidance on choosing this over sibling tools.

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