Skip to main content
Glama

Expand image (outpaint)

outpaint_image

Extend an image beyond its borders by setting expansion per side in pixels or percent; canvas, mask, and model-aligned sizes are built automatically while original pixels stay exact.

Instructions

Extend an image beyond its borders. Give the expansion per side in pixels or percent; the canvas, mask and model-aligned sizes are built automatically and the original pixels are preserved exactly.

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>",
      "prompt": "<prompt>"
    },
    "name": "outpaint_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNo
leftNo
seedNoSeed for reproducible results; omit or -1 for random. Never reuse the seed the source image was generated with: use a different one or omit it
rightNo
unitsNoUnits for left/right/top/bottom; percent is relative to the image width (left/right) or height (top/bottom)pixels
bottomNo
promptYesWhat the extended area should contain
qualityNoAll run Qwen-Image 2.1 Turbo (8 steps): fast = ~1 MP (the default, fastest); balanced = ~1.5K; quality = native 2K (slowest; edits share 2K with their references)
image_pathYes
output_pathNoOptional destination (absolute, or relative to the project). Must be inside the project or the app output folder. Existing files are never overwritten; a numbered name is used instead.
include_previewNoAlso return a small JPEG preview in the tool result. Default false: images stay local and are not sent to the model.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.2
    • changedInput schema / properties / seed / description
      Previous value: -"Seed for reproducible results; omit or -1 for random"New value: +"Seed for reproducible results; omit or -1 for random. Never reuse the seed the source image was generated with: use a different one or omit it"
  2. First observedv0.9.3

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare the mutation profile (readOnly=false, destructive=false, idempotent=false), and the description adds real behavioral value on top: canvas, mask and model-aligned sizes are built automatically, and the original pixels are preserved exactly. It does not cover the seed-reuse hazard or output-file naming, but those live in the schema.

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?

Two sentences, zero filler, and the core action is front-loaded before the per-side input convention. Nothing redundant with the title or schema is repeated.

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 an 11-parameter, output-less tool, the description covers the essential mechanic and the automatic-sizing guarantee. It stops short of noting that a prompt is required to describe the new area and that results are written to disk rather than returned inline, but those are recoverable from the schema.

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 only 55%, and the four undocumented direction parameters (top/left/right/bottom) plus image_path carry no descriptions. The description compensates by explaining that expansion is given per side and in pixels or percent, which is exactly the semantic those bare numbers need.

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: 'Extend an image beyond its borders' — a precise, unambiguous description of outpainting that an agent can immediately distinguish from generate_image, inpaint_image or upscale_image without opening any schema.

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

Usage Guidelines3/5

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

Usage is implied by the mechanic ('give the expansion per side in pixels or percent'), but there is no explicit statement of when to choose this over inpaint_image, edit_image or upscale_image, and no prerequisites called out. It is adequate orientation, not routing guidance.

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