Skip to main content
Glama

image.harmonize

Match a pasted subject's light and colour to its scene: a Reinhard colour transfer in CIELAB moves the subject's mean and spread toward the scene's, weighted by the subject mask, at strength 0..100 (default 80). Pixels outside the mask never change. Pass the composite plus a subject mask (white = subject, black = scene). Free: runs on the platform's own deterministic kernel, so the same input and arguments always return the same pixels. Takes PNG, JPEG, WebP, GIF or HEIC. Returns JSON {images:[{url, asset_key, download_url?, width, height}], price, next} plus a preview; images are stored in this workspace. Refuses: SIMPLER_MEDIA_INPUT_MISSING (pass the url or the asset_key), SIMPLER_MEDIA_FOREIGN_KEY (use this workspace's asset_key), SIMPLER_MEDIA_URL_REFUSED (use https, data:image or an asset_key), SIMPLER_MEDIA_PIN_TOO_LARGE (under 20MB), SIMPLER_EDIT_HARMONIZE_MASK_EMPTY (the mask selects no visible pixel: paint the subject white), SIMPLER_EDIT_HARMONIZE_NO_BACKGROUND (the mask covers everything: pass the whole composite with only the subject white), SIMPLER_EDIT_SERVER_PIXELS_NEEDS_PNG (the file is not an image: send a PNG, JPEG, WebP, GIF or HEIC), SIMPLER_EDIT_SERVER_PIXELS_TOO_LARGE (at most 4,194,304 pixels: run image.convert with width and height 2048 first), SIMPLER_IMAGES_BINDING_ABSENT (this deployment has no Images binding yet, owner step O-2: send a standard PNG), SIMPLER_IMAGES_QUOTA_EXCEEDED or SIMPLER_IMAGES_LEGACY_SUBSCRIPTION (an owner account step: send a standard PNG meanwhile), SIMPLER_IMAGES_INPUT_UNREADABLE (send a PNG, JPEG, WebP, GIF or HEIC), SIMPLER_IMAGES_INPUT_TOO_LARGE (under 20,000,000 bytes and 100 megapixels), SIMPLER_IMAGES_TRANSFORM_FAILED (retry, or send a standard PNG); nothing is charged on any of them, and INSUFFICIENT_CREDITS or PAYMENT_REQUIRED only when the workspace is already overdrawn or past its spend cap (add credits or raise the cap). NEXT: pass images[0].asset_key as image_asset_key to the next image.* tool, or open download_url when the result carries one.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "image.harmonize"
  }
}

Input Schema

NameRequiredDescriptionDefault
strengthNoHow far to move the subject toward the scene, 0..100 (default 80).
image_urlNoComposite image: a public https URL, a data:image/...;base64 URL, or the url/url_path of an earlier image result (max 20MB; PNG, JPEG, WebP or GIF; SVG is refused). Pass this or the matching *_asset_key, not both.
request_refNoOptional idempotency key (1-64 chars: letters, digits, . _ : -). Retrying with the same request_ref and the same arguments within 24 hours returns the first result at $0 with replayed: true; the same request_ref with different arguments is refused (SIMPLER_IMAGE_REQUEST_REF_CONFLICT), and so is a retry whose first result was deleted since (SIMPLER_IMAGE_REQUEST_REF_RESULT_DELETED): send a new request_ref to run it again.
preview_formatNoPreview block after the JSON, at most 384px on the long edge and never charged: png, jpeg or none. Left out, a PNG result gets a png preview and a JPEG or WebP result a jpeg one. A result with no preview says why in preview_unavailable.
image_asset_keyNoComposite image, as the asset_key of an earlier image result for this workspace (edit-projects/<tenant>/... or images/<tenant>/...). A key from another workspace is refused (SIMPLER_MEDIA_FOREIGN_KEY).
subject_mask_urlNoSubject mask (white = subject): a public https URL, a data:image/...;base64 URL, or the url/url_path of an earlier image result (max 20MB; PNG, JPEG, WebP or GIF; SVG is refused). Pass this or the matching *_asset_key, not both.
subject_mask_asset_keyNoSubject mask (white = subject), as the asset_key of an earlier image result for this workspace (edit-projects/<tenant>/... or images/<tenant>/...). A key from another workspace is refused (SIMPLER_MEDIA_FOREIGN_KEY).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / strength / description
      Previous value: -"How far to move the subject toward the scene, 0..100 (default 60)."New value: +"How far to move the subject toward the scene, 0..100 (default 80)."
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Well beyond the single readOnlyHint=false annotation, the description discloses determinism ('same input and arguments always return the same pixels'), that it is free, that nothing is charged on failures, that pixels outside the mask never change, and that results are stored in this workspace. Error codes come with actionable remedies (e.g. run image.convert with width and height 2048 first), which is exactly what a paid mutation tool should reveal.

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 core definition and constraints are front-loaded in the first three sentences, which is the right order. The long enumeration of refusal codes is informative but dense, and a few entries could be grouped by category without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates fully: it gives the exact return envelope {images:[{url, asset_key, download_url, width, height}], price, next} plus preview behavior and the chaining instruction. For a 7-parameter, no-required-params mutation tool with sparse annotations, this is complete enough to invoke correctly on the first try.

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 the schema already documents strength, both image inputs, both mask inputs, request_ref and preview_format. The description restates the strength default of 80 and mask polarity but adds little new parameter meaning beyond the 4,194,304-pixel ceiling and its workaround, so the baseline 3 applies.

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 opening clause names a precise verb and resource — 'Match a pasted subject's light and colour to its scene' — and even discloses the underlying algorithm (Reinhard colour transfer in CIELAB). This clearly separates it from sibling tools like image.adjust, image.style_transfer and image.segment_at, which do different transformations.

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?

It states the required input shape (composite plus subject mask, white = subject, black = scene), which error codes are recoverable, and how to chain forward via images[0].asset_key. It does not explicitly contrast with image.style_transfer or image.cut_background, so the agent must infer which image.* tool fits a given intent.

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