Skip to main content
Glama

Remove the background from an image

replicate_remove_background

Remove the background from an image URL and return a transparent PNG, with optional model selection and local download.

Instructions

Produce a transparent-background version (PNG) of an image.

DISPLAY REQUIREMENT — after this tool returns successfully, embed the cut-out image inline using one of the three blocks (iframe / / markdown) printed by the tool.

Args:

  • image (string URL): URL of the source image.

  • model (string, default "rembg"): Curated key (rembg, birefnet, briaai-rmbg) or "owner/name".

  • extra_input (object, optional): Model-specific extras.

  • download (boolean, default true): Download the cut-out PNG locally.

Returns: PredictionResult with urls + local_paths to a transparent PNG.

Examples:

  • image="" → rembg quick cut

  • image="", model="birefnet" → sharper edge for hair

Input Schema

NameRequiredDescriptionDefault
imageYesURL of the image whose background to remove.
modelNoBackground remover. Curated: rembg, birefnet, briaai-rmbg. Or "owner/name".rembg
downloadNo
timeout_msNoMax ms to wait for the prediction. If exceeded, returns the prediction ID so you can poll via replicate_get_prediction. Default: 300000 (5min).
extra_inputNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.3.1
    • addedInput schema / properties / extra_input / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  2. First observedv3.2.3

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare non-read-only, open-world, non-idempotent, non-destructive, but the description adds real value beyond that: a display requirement that the returned PNG must be embedded inline, the download-to-local default, and the return shape (urls + local_paths). The timeout/polling fallback is left to 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then the display requirement, then args/returns/examples. Slight redundancy between the arg text and examples, but every block carries usable information.

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?

With no output schema, the description supplies the return type and the local_paths detail, plus the post-call display obligation an agent would otherwise miss. Missing only the timeout/polling behavior, which the schema explains.

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 60%, and the description documents 4 of 5 params including the curated model keys plus the 'owner/name' escape hatch, and clarifies extra_input is model-specific. It adds semantic hints (which model suits which image) not present in the schema, though timeout_ms is only covered by the schema.

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 specific verb+resource+output format: 'Produce a transparent-background version (PNG) of an image.' This clearly separates it from segmentation, inpainting, upscaling and other image siblings.

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?

The two examples give concrete selection guidance ('rembg quick cut' vs 'birefnet sharper edge for hair'), which effectively tells the agent which model to pick. It stops short of naming alternatives/exclusions relative to siblings like replicate_segment or replicate_inpaint.

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