Skip to main content
Glama

Convert image format

convert_image

Convert a local image to PNG, JPEG, WebP, AVIF, TIFF, or GIF, with quality and lossless controls; JPEG output is flattened onto a chosen background color.

Instructions

Convert a local image to PNG, JPEG, WebP, AVIF, TIFF or GIF. JPEG output is flattened onto the given background color (white by default).

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": {
      "image": "<image>",
      "output_format": "<output_format>"
    },
    "name": "convert_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageYesAbsolute path to a local image on the machine running this MCP server.
qualityNoEncoder quality (1-100). Applies to JPEG, WebP, AVIF and TIFF output.
losslessNoUse lossless encoding where supported (WebP and AVIF).
file_nameNoOptional base file name; path separators are not allowed. The actual image format determines the extension. When multiple outputs are produced, -1, -2, ... suffixes are appended. Existing files are never overwritten.
backgroundNoCSS color used as the background, for example #ffffff or transparent.
output_dirNoAbsolute directory where the output file is saved. Defaults to IMG_OUTPUT_DIR, or ~/img-output. The directory is created automatically.
output_formatYesOutput image format. PNG, JPEG, WebP, AVIF, TIFF and GIF are supported.
compression_levelNoPNG compression level (0-9); higher is smaller and slower.

Output Schema

NameRequiredDescriptionDefault
imageYes
sourceYes
detailsNo
operationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare the write/safety profile (readOnly=false, destructive=false, openWorld=false, idempotent=false), so the bar is lower. The description still adds two non-obvious behavioral facts beyond the structured fields: only local files are accepted, and JPEG output is flattened onto the background color with white as the default — a detail that materially changes results for transparency-bearing inputs.

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, front-loaded with the formats supported and followed by the one behavioral caveat that matters. Nothing is wasted and nothing needed is buried later in the text.

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 an output schema present, return values need not be explained, and the input schema is fully documented, so the description only has to frame purpose and any surprising behavior — both are covered. The remaining gap is disambiguation from the other image-manipulation siblings, which the definition leaves to inference.

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% and all eight parameters carry their own descriptions (quality, lossless, compression_level, background, file_name, output_dir). The description contributes almost no additional parameter meaning beyond implicitly naming the background color, so the baseline 3 applies.

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 pairs a specific verb (convert) with the resource (a local image) and enumerates every supported target format, so an agent knows exactly what it produces. It does not explicitly distinguish itself from siblings like compress_image or resize_image, which keeps it below a 5.

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 only implied: the format list and the 'local image' qualifier suggest this is the tool for changing encoding rather than pixel dimensions or similarity. There is no explicit when-to-use, when-not-to-use, or named alternative, so an agent facing compress_image/resize_image must infer the boundary itself.

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