Skip to main content
Glama

Metadata MCP Connector

Resize Image

resize_image

Make a resized copy of an image at an exact pixel size. Deterministic image processing: no AI model runs and nothing in the image is redrawn.

USE FOR: fitting an existing image (an uploaded file, a library creative, a creative made earlier) to a placement's size, e.g. LinkedIn 1200x628 or 1200x1200, Meta feed 1080x1080 or 1440x1800, Stories 1080x1920, display 300x250 or 728x90.

SIZE: give width and height for an exact size, or only one of them to scale proportionally. Each side is at most 4096 px.

WHEN THE SHAPE CHANGES (width and height given, in an aspect ratio other than the source's), fit decides:

  • pad (default): keeps the whole image, scaled to fit inside the target, and fills the empty bands with background. Nothing is cut off or distorted.

  • crop: scales the image to cover the target and trims the overflow, keeping the part named by crop_focus. WARNING: text, logos or faces near the trimmed edges are lost.

  • stretch: scales each side independently. Distorts the image; use it only when asked to. A source within 1% of the target's shape is scaled straight to the exact size.

DOES NOT: redesign or re-lay out a creative for a new shape, change the source image, or save anything to the creatives library.

OUTPUT: the URL of a NEW image (s3_url), stored temporarily outside the creatives library, with its image_size, the source's source_size, fit_applied (none when the shape was kept), the pad's background, upscaled (true when the source was enlarged, which cannot add detail and looks softer) and format. To use it in an ad, upload the URL with upload_image_creative, which gives it a NEW library id.

Input Schema

NameRequiredDescriptionDefault
fitNoHow to reach a target of another shape: pad, crop or stretch, as the tool description explains. Ignored when only one side is given.pad
widthNoTarget width in pixels. Omit it to scale proportionally from `height`.
heightNoTarget height in pixels. Omit it to scale proportionally from `width`.
backgroundNoWhat fills the bands `pad` adds: 'auto' (the image's own edges extended into the bands, row by row beside it or column by column above and below, so the seam shows no jump: a plain background continues as one flat color and a gradient as itself; transparent edges stay transparent), 'blur' (a blurred, enlarged copy of the image), 'transparent', or a color such as '#FFFFFF'. Ignored by crop and stretch.auto
crop_focusNoThe part of the image `crop` keeps. Ignored by pad and stretch.center
image_sourceYesURL of the image to resize: a public http(s) URL of a PNG, JPEG, WebP, GIF, BMP or TIFF image (an animation gives its first frame), such as an uploaded file, a library creative's URL, or a URL returned by an earlier creative tool. At most 25 MB and 25 megapixels; a larger JPEG is accepted when the target is small enough to decode it at a reduced scale.
output_formatNo'auto' keeps a JPEG source as JPEG and writes PNG otherwise, switching to JPEG when an opaque PNG would pass 5 MB, the image limit of most ad channels. 'png' keeps transparency; 'jpeg' puts transparent areas on white.auto

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only say readOnly=false, destructive=false, openWorld=true, so the description carries real weight and delivers: deterministic processing with no model, source image untouched, nothing written to the creatives library, output stored temporarily at a separate URL, and the honest caveat that upscaling cannot add detail and looks softer. It also warns that crop discards text/logos/faces near trimmed edges.

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?

Front-loaded one-line summary, then labelled blocks (USE FOR, SIZE, WHEN THE SHAPE CHANGES, DOES NOT, OUTPUT) with the destructive warning placed right where the risky option is described. Length is justified by a 7-parameter tool with three interacting enums; no sentence is redundant.

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 by enumerating every returned field (s3_url, image_size, source_size, fit_applied, background, upscaled, format) and its meaning. Combined with the fit trade-offs, source constraints, and the required follow-up call, an agent has everything needed to invoke and chain this tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description goes further than the schema by explaining the sizing rule (both sides for exact, one side for proportional, 4096 cap) and the decision logic behind fit/crop_focus/background, including which choices are ignored in which mode. The only shortfall is that a few nuances (e.g. output_format auto behavior, the 25 MB/25 MP limits) live mainly in the schema text.

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?

Opens with a precise verb+resource+outcome ('make a resized copy of an image at an exact pixel size') and immediately scopes it against the sibling family by stating no AI model runs and nothing is redrawn, which separates it from generate_brand_creative / render_flexible_creative. The DOES NOT block further fences it off from redesign tools and from upload_image_creative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

An explicit 'USE FOR' section names the exact scenario (fitting an existing image to a placement's size) with concrete channel dimensions, and 'DOES NOT' enumerates what to use something else for instead. It even routes the agent forward ('upload the URL with upload_image_creative'), leaving nothing to inference.

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