Skip to main content
Glama

localize_image

Replace on-image text with translations while preserving layout, colors, and graphics. Saves localized image to disk and returns the file path.

Instructions

Localize an image in place by replacing its on-image text with translations.

Keeps every non-text element (layout, colours, graphics) intact and re-renders the original text with the provided translations. Pair with extract_image_text (to get the source strings) and translate (to translate them with TM and brand voice) for a full image localization flow.

The localized image is saved to disk and the file path is returned — the raw image bytes are not sent back to the model.

Args: image_path: Path to a local PNG, JPEG, or WebP image to localize. replacements: JSON array of {"original": "...", "translated": "..."} pairs, e.g. '[{"original": "Buy now", "translated": "Achetez maintenant"}]'. target_language_code: Target language code (e.g. "fr-FR"), used for labelling output. output_path: Optional path to write the localized image to. Defaults to ".." next to the source image. num_images: Number of variants to generate (1-5, default 1). output_format: Output format — png, jpeg, or webp (default png).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_pathYes
num_imagesNo
output_pathNo
replacementsYes
output_formatNopng
target_language_codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the disclosure burden. It explicitly states the localized image is saved to disk, a file path is returned, and raw bytes are not sent back to the model – valuable for an agent deciding whether to use this tool. It also explains that non-text elements remain intact and describes the default output naming, but it leaves some ambiguity about whether the original file is modified ('in place' vs. separate output path) and does not mention permissions or failure modes.

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 leads with a one-sentence summary, then adds behavioral and workflow context in short paragraphs, and closes with a bulleted Args list. Every sentence adds meaning: the pairing note is actionable, the output note avoids false expectations, and the Args block is essential given the schema's silence. No filler.

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 six-parameter tool with no annotations, the description is close to complete: all parameters are explained, output behavior is described, and the integration with extract_image_text and translate sets expectations. Minor gaps are the ambiguous 'in place' wording and lack of explicit error/prerequisite discussion, but the presence of an output schema likely covers return details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the Args section must supply all parameter meaning – and it does comprehensively. It explains accepted formats for image_path, gives a precise JSON structure and example for replacements, states target_language_code is used for labelling, defines output_path default naming, constrains num_images to 1–5, and lists output_format values. This fully compensates for the bare 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 opens with a specific verb-resource pair: 'Localize an image in place by replacing its on-image text with translations.' It further distinguishes the tool by stating non-text elements are preserved and by naming companion tools (`extract_image_text`, `translate`), making its role in the localization flow clear. Though it doesn't explicitly contrast with `localize_subtitles`, the 'image' resource and text-replacement operation are enough to select it.

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 gives a clear workflow: pair with `extract_image_text` to obtain source strings and `translate` for TM/brand-voice translation, which tells an agent when to use this tool in the pipeline. It does not, however, state when not to use it or name alternatives (e.g., `localize_subtitles` for subtitle files), leaving some selection burden on the tool name.

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