Skip to main content
Glama

Replace Background

replace_background

Replace the background of any image by describing the new scene in a text prompt while keeping the foreground subject intact.

Instructions

Replace the background of an image while preserving the foreground subject. Provide a text prompt describing the new background.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoNumber of output images (1-6).
imageYesSource image as a URL or base64-encoded string.
modelNoModel to use.
styleNoStyle category.
promptYesDescription of the new background.
style_idNoCustom style ID.
substyleNoSubstyle.
random_seedNoSeed for reproducibility.
image_formatNoOutput format.
negative_promptNoWhat to avoid.
Behavior3/5

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

Annotations already indicate readOnlyHint=false (modification) and openWorldHint=true (unpredictable). The description adds that the foreground is preserved, but does not disclose other behavioral traits like potential failures, destructive effects, or rate limits. It provides some additional context but not extensive.

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?

The description is two concise sentences with no wasted words. It front-loads the core action and immediately follows with the key guidance about the prompt.

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?

Given the tool's complexity (10 parameters, no output schema), the description covers the essential behavior and required input. It lacks return value details (e.g., output images), but annotations and schema partially fill gaps. Almost complete for an AI to select and invoke correctly.

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 parameters well. The description mentions the 'prompt' parameter's purpose ('Provide a text prompt describing the new background'), but adds no significant meaning beyond the schema. Baseline 3 is appropriate.

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 clearly states 'Replace the background of an image while preserving the foreground subject', which specifies the verb 'replace' and the resource 'background of an image'. This distinguishes it from siblings like 'remove_background' and 'generate_background'.

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?

The description implies when to use (when you want to replace the background with a text-described scene), but does not explicitly state when not to use or compare to alternatives. Sibling tools like 'remove_background' and 'generate_background' are not mentioned, leaving some ambiguity.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BartWaardenburg/recraft-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server