Skip to main content
Glama

Replace Background

sirv_replace_background

Replace an image's background while preserving its subject, and define the new backdrop with a text prompt or style reference image.

Instructions

Replace the background of one image and keep its subject. Describe the new background in prompt, or give a style image in ref_image_url.

Use it for a new backdrop. For a lifestyle scene with control over where the product sits, use sirv_place_product_in_scene. For a transparent background, use sirv_remove_background.

The default model keeps the product's own pixels. The source image does not change. Returns the result URL.

Credits: spends workspace credits. The cost depends on the model and options.

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_url": "<image_url>"
    },
    "name": "sirv_replace_background"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNoModel. ideogram-keep keeps the product's own pixels; the others can redraw the product. Default: ideogram-keepideogram-keep
promptNoThe new background, in words. Give this or ref_image_url
image_urlYesPublic URL of the image whose subject to keep
ref_image_urlNoPublic URL of an image whose style the new background copies. Give this or prompt

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

The description adds real behavior beyond the annotations: the source image is not modified, the default model preserves the product's own pixels while others may redraw it, and the call spends workspace credits whose cost varies by model and options. That credit-spend warning is the kind of cost signal annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false) cannot convey. It stops short of noting non-idempotency or turnaround/async behavior, which would have made it a 5.

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 with the core action, then alternatives, then behavior, then cost — each sentence earning its place with no repetition or filler. Paragraphing separates 'what it does' from 'what it costs', which is the right priority order for an agent.

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?

For a four-parameter, output-schema-less generation tool, the definition covers the action, the input alternatives, source-image safety, the default model's distinguishing behavior, sibling routing, and cost. It also states the return ('Returns the result URL'), so nothing an agent needs before invoking is missing.

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% and every parameter already carries a description, including the 'Give this or prompt' alternation and the ideogram-keep pixel-preservation meaning. The description restates that alternation at a high level but introduces no syntax, format, or constraint details the schema lacks, 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 description names a specific verb and resource ('Replace the background of one image and keep its subject') and states the two mutually exclusive ways to specify the new background (prompt or ref_image_url). It also explicitly names the siblings it is not: sirv_place_product_in_scene for lifestyle scenes and sirv_remove_background for transparent backgrounds.

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?

It gives explicit when-to-use and when-to-use-something-else guidance: 'Use it for a new backdrop', then routes to sirv_place_product_in_scene for controlled product placement and sirv_remove_background for transparency. The agent can choose among three visually similar tools without opening schemas.

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