Skip to main content
Glama

convert_image

Re-encode generated images to PNG, JPEG, or WebP formats. Accepts asset IDs or local file paths with configurable quality and compression options.

Instructions

Re-encode a generated image to PNG, JPEG, or WebP and return it inline as an image content block. Source can be a registered asset_id or a path under the local ComfyUI output directory. Optionally writes the converted image back under the output directory and reports source/output size plus bytes saved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asset_idNoRegistered asset id from a completed job. Provide exactly one of asset_id or path.
pathNoPath to a source image under COMFYUI_PATH/output. Provide exactly one of asset_id or path.
formatYesTarget encoded image format.
qualityNoEncoder quality, 1-100. Applies where supported by the selected format.
progressiveNoJPEG only: write a progressive JPEG.
losslessNoWebP only: write lossless WebP.
effortNoWebP only: encoder effort, 0-6.
out_pathNoOptional output path under COMFYUI_PATH/output where the converted image should be written.
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the result is returned inline, optionally written to disk, and reports sizes and bytes saved. It does not mention potential side effects like overwriting, but the behavior is mostly transparent.

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 that are direct and front-loaded. Every sentence adds essential information without redundancy.

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?

The description covers the main workflow (source, conversion, output, reporting). Given 8 parameters and no output schema, it provides adequate context. Minor omission: it doesn't clarify that format-specific parameters are ignored for other formats, but the schema's 'Applies where supported' somewhat addresses this.

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%, so baseline is 3. The description adds context about reporting sizes and mutual exclusivity of asset_id and path, but doesn't significantly enhance parameter understanding beyond the schema.

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's purpose: 'Re-encode a generated image to PNG, JPEG, or WebP and return it inline'. It also specifies the source options and optional file write, making it distinct from sibling tools like get_image, view_image, and upload_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 for when to use the tool (to convert images) and explains the source selection (asset_id or path). While it doesn't explicitly state when not to use it or name alternatives, the context is sufficient given the sibling list.

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/artokun/comfyui-mcp'

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