Skip to main content
Glama

image_convert

Read-onlyIdempotent

Convert an image to PNG, JPEG, WebP, AVIF, GIF, TIFF, BMP or ICO, with optional quality, background colour, resize (fit modes), rotate/flip, grayscale, DPI and metadata controls. Inputs: JPEG, PNG, WebP, GIF (animated kept for GIF/WebP output), AVIF, TIFF, SVG, BMP. HEIC is not supported. Returns the converted file as base64 text.

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": {
      "fileBase64": "<fileBase64>",
      "format": "<format>"
    },
    "name": "image_convert"
  }
}

Input Schema

NameRequiredDescriptionDefault
dpiNoPrint resolution written into PNG, JPEG, TIFF and BMP
fitNoHow the picture meets width and height. Default inside
blurNotrue for a light blur, or a strength number.
flipNoMirror top to bottom
flopNoMirror left to right
sizesNoICO sizes, from 16, 32, 48, 64, 128, 256 (e.g. '16,32,48'). Default 16,32,48
widthNoWidth (1 to 16384) as a plain number, for example 10.
effortNo0 fastest to 10 smallest file (clamped to what the format allows; 'speed' is the same thing)
formatYespng, jpeg (or jpg), webp, avif, gif, tiff, bmp or ico; image/... types such as image/webp also work
heightNoHeight (1 to 16384) as a plain number, for example 10.
rotateNoMultiple of 90 degrees clockwise (not for animated images)
qualityNo0-1 (for example 0.8) or 1-100 (for example 80); JPEG, WebP, AVIF (and TIFF with jpeg compression, palette PNG)
sharpenNotrue for default sharpening, or a strength number.
animatedNoKeep every frame of an animated GIF/WebP when the output is GIF or WebP. Default true
bitDepthNoBMP: 24 (no transparency) or 32 (keeps transparency)
losslessNoWebP/AVIF lossless; false on PNG makes a smaller 256-colour palette PNG
grayscaleNotrue or false: grayscale. Default false.
autoOrientNoTurn photos upright from their EXIF rotation flag. Default true
fileBase64YesThe input file as a base64 string, without a data: prefix.
pngPaletteNoPNG: reduce to a 256-colour palette for a smaller file
progressiveNoJPEG progressive scan
stripMetadataNoRemove EXIF/ICC data. Default true; false keeps it
backgroundColorNoFill for transparent areas, e.g. '#ffffff', 'ffffff' or 'white'. Default white for JPEG and 24-bit BMP; for other formats only applied when given
tiffCompressionNoTiff compression: one of none, lzw, deflate, jpeg.
chromaSubsamplingNoJPEG/AVIF colour detail: 4:4:4 sharpest, 4:2:0 smaller
withoutEnlargementNoNever make the picture bigger than the original
pngCompressionLevelNoPng compression level (0 to 9) as a plain number, for example 9.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / blur / description
      Added value: +"true for a light blur, or a strength number."
    • addedInput schema / properties / fileBase64 / description
      Added value: +"The input file as a base64 string, without a data: prefix."
    • addedInput schema / properties / grayscale / description
      Added value: +"true or false: grayscale. Default false."
    • addedInput schema / properties / height / description
      Added value: +"Height (1 to 16384) as a plain number, for example 10."
    • addedInput schema / properties / pngCompressionLevel / description
      Added value: +"Png compression level (0 to 9) as a plain number, for example 9."
    • addedInput schema / properties / sharpen / description
      Added value: +"true for default sharpening, or a strength number."
    • addedInput schema / properties / tiffCompression / description
      Added value: +"Tiff compression: one of none, lzw, deflate, jpeg."
    • addedInput schema / properties / width / description
      Added value: +"Width (1 to 16384) as a plain number, for example 10."
  2. Changed28 schema fields changed
    • addedInput schema / properties / animated
      Added value: +{
      +  "description": "Keep every frame of an animated GIF/WebP when the output is GIF or WebP. Default true",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / autoOrient
      Added value: +{
      +  "description": "Turn photos upright from their EXIF rotation flag. Default true",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / backgroundColor / description
      Previous value: -"CSS color, e.g. '#ffffff' -- used to fill transparent areas when converting to JPEG"New value: +"Fill for transparent areas, e.g. '#ffffff', 'ffffff' or 'white'. Default white for JPEG and 24-bit BMP; for other formats only applied when given"
    • addedInput schema / properties / bitDepth
      Added value: +{
      +  "description": "BMP: 24 (no transparency) or 32 (keeps transparency)",
      +  "enum": [
      +    24,
      +    32
      +  ],
      +  "type": "number"
      +}
    • addedInput schema / properties / blur
      Added value: +{
      +  "type": [
      +    "boolean",
      +    "number"
      +  ]
      +}
    • addedInput schema / properties / chromaSubsampling
      Added value: +{
      +  "description": "JPEG/AVIF colour detail: 4:4:4 sharpest, 4:2:0 smaller",
      +  "enum": [
      +    "4:4:4",
      +    "4:2:0"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / dpi
      Added value: +{
      +  "description": "Print resolution written into PNG, JPEG, TIFF and BMP",
      +  "maximum": 2400,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / effort
      Added value: +{
      +  "description": "0 fastest to 10 smallest file (clamped to what the format allows; 'speed' is the same thing)",
      +  "maximum": 10,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / fit
      Added value: +{
      +  "description": "How the picture meets width and height. Default inside",
      +  "enum": [
      +    "cover",
      +    "contain",
      +    "fill",
      +    "inside",
      +    "outside"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / flip
      Added value: +{
      +  "description": "Mirror top to bottom",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / flop
      Added value: +{
      +  "description": "Mirror left to right",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / format / description
      Added value: +"png, jpeg (or jpg), webp, avif, gif, tiff, bmp or ico; image/... types such as image/webp also work"
    • removedInput schema / properties / format / enum
      Removed value: -[
      -  "image/png",
      -  "image/jpeg"
      -]
    • addedInput schema / properties / grayscale
      Added value: +{
      +  "type": "boolean"
      +}
    • addedInput schema / properties / height
      Added value: +{
      +  "maximum": 16384,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / lossless
      Added value: +{
      +  "description": "WebP/AVIF lossless; false on PNG makes a smaller 256-colour palette PNG",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / pngCompressionLevel
      Added value: +{
      +  "maximum": 9,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / pngPalette
      Added value: +{
      +  "description": "PNG: reduce to a 256-colour palette for a smaller file",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / progressive
      Added value: +{
      +  "description": "JPEG progressive scan",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / quality / description
      Added value: +"0-1 (for example 0.8) or 1-100 (for example 80); JPEG, WebP, AVIF (and TIFF with jpeg compression, palette PNG)"
    • changedInput schema / properties / quality / maximum
      Previous value: -1New value: +100
    • addedInput schema / properties / rotate
      Added value: +{
      +  "description": "Multiple of 90 degrees clockwise (not for animated images)",
      +  "type": "integer"
      +}
    • addedInput schema / properties / sharpen
      Added value: +{
      +  "type": [
      +    "boolean",
      +    "number"
      +  ]
      +}
    • addedInput schema / properties / sizes
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    }
      +  ],
      +  "description": "ICO sizes, from 16, 32, 48, 64, 128, 256 (e.g. '16,32,48'). Default 16,32,48"
      +}
    • addedInput schema / properties / stripMetadata
      Added value: +{
      +  "description": "Remove EXIF/ICC data. Default true; false keeps it",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / tiffCompression
      Added value: +{
      +  "enum": [
      +    "none",
      +    "lzw",
      +    "deflate",
      +    "jpeg"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / width
      Added value: +{
      +  "maximum": 16384,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / withoutEnlargement
      Added value: +{
      +  "description": "Never make the picture bigger than the original",
      +  "type": "boolean"
      +}
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered; the description adds genuinely needed behavior by stating the result comes back as base64 text. It also discloses that unsupported HEIC input will fail and that animation survives only for GIF/WebP outputs. It does not warn about payload size or token cost of large base64 results.

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, capability and accepted formats first, return value last; the long format enumerations are load-bearing rather than filler. No restatement of the tool name or empty hedging.

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?

For a 27-parameter tool with no output schema, it covers the critical unknowns: accepted inputs, unsupported input, animation behavior, and that output is base64 text. It stops short of practical operational details such as input/output size limits or error behavior on invalid formats.

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 coverage is 100%, so baseline is 3, and the description adds real value on top by listing which input formats fileBase64 accepts (JPEG, PNG, WebP, GIF, AVIF, TIFF, SVG, BMP) and summarizing the optional control groups (quality, background, fit-mode resize, rotate/flip, grayscale, DPI, metadata). It still leaves individual interactions to the schema, such as how fit interacts with width/height.

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?

States a specific verb and resource (convert an image) and enumerates every output format (PNG, JPEG, WebP, AVIF, GIF, TIFF, BMP, ICO), so the operation is unambiguous. It does not name or differentiate against siblings like image_resize, image_rotate or image_flip even though it overlaps with them, which keeps it from 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operating context: accepted inputs, unsupported input (HEIC), how animation is handled, and which output formats require which option. It never explicitly says when to prefer image_convert over the dedicated crop/rotate/resize siblings, so the choice is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources