Skip to main content
Glama

localize_image

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. Hosted mode returns a
download URL instead of writing to a local path.

Args:
    image_path: Public HTTPS URL (hosted) or local path (stdio) to a 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
        "<input>.<lang>.<format>" 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).

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_path": "<image_path>",
      "replacements": "<replacements>",
      "target_language_code": "<target_language_code>"
    },
    "name": "localize_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
image_pathYesPublic HTTPS URL (hosted) or local path (stdio) to a PNG, JPEG, or WebP image to localize.
num_imagesNoNumber of variants to generate (1-5, default 1).
output_pathNoOptional path to write the localized image to. Defaults to "<input>.<lang>.<format>" next to the source image.
replacementsYesJSON array of {"original": "...", "translated": "..."} pairs, e.g. '[{"original": "Buy now", "translated": "Achetez maintenant"}]'.
output_formatNoOutput format — png, jpeg, or webp (default png).png
target_language_codeYesTarget language code (e.g. "fr-FR"), used for labelling output.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / image_path / description
      Added value: +"Public HTTPS URL (hosted) or local path (stdio) to a PNG, JPEG, or WebP image to localize."
    • addedInput schema / properties / num_images / description
      Added value: +"Number of variants to generate (1-5, default 1)."
    • addedInput schema / properties / output_format / description
      Added value: +"Output format — png, jpeg, or webp (default png)."
    • addedInput schema / properties / output_path / description
      Added value: +"Optional path to write the localized image to. Defaults to \"<input>.<lang>.<format>\" next to the source image."
    • addedInput schema / properties / replacements / description
      Added value: +"JSON array of {\"original\": \"...\", \"translated\": \"...\"} pairs, e.g. '[{\"original\": \"Buy now\", \"translated\": \"Achetez maintenant\"}]'."
    • addedInput schema / properties / target_language_code / description
      Added value: +"Target language code (e.g. \"fr-FR\"), used for labelling output."
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does well: it discloses that non-text elements are preserved, that output is written to disk and only the path is returned (not raw bytes), and that hosted mode returns a download URL instead. Remaining gaps are auth/permission requirements and what happens when `output_path` already exists or a replacement string is missing from the image.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The behavioral summary is front-loaded and efficient, but the Args section duplicates schema text that the agent already receives, adding length without new information. Structure is otherwise clean and scannable.

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?

An output schema exists, so return values need little explanation, yet the description still helps by stating the path-vs-URL distinction. For a 6-parameter mutation tool with no annotations, it covers the essentials but omits overlap/overwrite behavior and error conditions.

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 100%, so the Args block largely restates the schema verbatim. One genuinely additive detail is that `target_language_code` is 'used for labelling output' only — clarifying that actual translations come from `replacements`, not from this parameter. That nuance is useful but modest, so the baseline 3 is right.

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?

States a specific verb and resource ('Localize an image in place by replacing its on-image text with translations') and immediately distinguishes itself from the extraction and translation siblings by describing it as the render step that consumes their output.

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?

Explicitly describes the pipeline: use `extract_image_text` to get source strings and `translate` to translate them, then call this tool. Also clarifies the hosted-vs-stdio calling mode for `image_path`. No explicit 'do not use when' condition, which keeps it from a 5.

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.