Skip to main content
Glama

image.add_shadow

Add a product shadow to a cut-out (subject on transparency), cast from its alpha: kind drop, contact or reflection. angle 0..359 is the light direction counterclockwise from 3 o'clock (default 120; the shadow falls the other way); distance 0..200 px (unset: 3.5% of the subject's height, at least 12; the gap under the base for a reflection); blur 0..100 px (unset: 5% of the subject's height, at least 16); opacity 0..100 (default 65); transparent true (default) keeps the backdrop see-through, false fills background #RRGGBB (default #ffffff) behind the shadow. contact ignores angle and distance, reflection ignores angle. The result grows past the input by the shadow's reach (distance plus blur) so no visible shadow pixel is cut: output pad {left, top, right, bottom} gives the growth in input pixels and subject_box the subject in the result; clipped true means the growth was trimmed to stay within 4,194,304 pixels. 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_SHADOW_NEEDS_CUTOUT (no transparent pixels: run image.cut_background and pass its asset_key), VALIDATION_ERROR with reason SIMPLER_EDIT_TOOL_ARGS_INVALID for a value out of range, 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.add_shadow"
  }
}

Input Schema

NameRequiredDescriptionDefault
blurNoEdge softness in pixels, 0..100 (unset: 5% of the subject's height, at least 16).
kindNoShadow kind (default drop).
angleNoLight direction in degrees, counterclockwise from 3 o'clock (default 120).
opacityNoShadow strength, 0..100 (default 65).
distanceNoOffset in pixels, 0..200 (unset: 3.5% of the subject's height, at least 12).
image_urlNoCut-out subject on transparency: 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.
backgroundNo#RRGGBB backdrop used when transparent is false (default #ffffff). The word transparent is also accepted and means transparent true; it cannot be combined with transparent false.
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.
transparentNotrue (default) keeps the backdrop see-through; false fills background behind the shadow.
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_keyNoCut-out subject on transparency, 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. Changed3 schema fields changed
    • changedInput schema / properties / blur / description
      Previous value: -"Edge softness in pixels, 0..100 (default 16)."New value: +"Edge softness in pixels, 0..100 (unset: 5% of the subject's height, at least 16)."
    • changedInput schema / properties / distance / description
      Previous value: -"Offset in pixels, 0..200 (default 12)."New value: +"Offset in pixels, 0..200 (unset: 3.5% of the subject's height, at least 12)."
    • changedInput schema / properties / opacity / description
      Previous value: -"Shadow strength, 0..100 (default 50)."New value: +"Shadow strength, 0..100 (default 65)."
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false, so the description carries the burden and does so richly: it discloses cost ('Free', nothing charged on any refusal), determinism of the kernel, that output grows beyond the input with a pad/subject_box/clipped report, the 4,194,304-pixel clipping cap, accepted formats, storage in this workspace, and the full refusal taxonomy with per-code remedies.

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?

Purpose and kinds are front-loaded in the first clause, and the parameter, output, and failure blocks follow separately. The error catalogue is unusually long and chained with semicolons in dense prose, which is defensible for agent recovery but makes the text heavier than it needs to be.

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?

Eleven parameters, no output schema, yet the description documents the return JSON shape (images/price/next), the growth-report fields, and the preview behavior. An agent has everything needed to call it, handle failure, and chain the result.

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 100%, so 3 is the floor, but the description adds genuine cross-parameter meaning absent from the schema: the shadow falls opposite the angle direction, contact ignores angle and distance, reflection ignores angle, and distance means the gap under the base for a reflection. It also spells out the transparent/background interaction and defaults.

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 ('Add a product shadow to a cut-out'), names the exact input precondition (subject on transparency, cast from its alpha) and enumerates the three kinds. This is clearly distinguishable from siblings such as image.cut_background or image.adjust, which do different pixel work.

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 the concrete precondition ('cut-out (subject on transparency)') and routes the agent to the alternative when it fails: SIMPLER_EDIT_SHADOW_NEEDS_CUTOUT says to run image.cut_background and pass its asset_key. Also states kind-selection constraints (contact ignores angle/distance, reflection ignores angle) and the NEXT step. It does not, however, contrast itself against nearby siblings like image.harmonize or image.replace_background.

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