Skip to main content
Glama

Remove image background

remove_background
Read-only

Remove the background from an image and return the cutout. Provide exactly one of image_url or image_base64. Returns a transparent PNG by default, or the subject on a solid colour when bg_color is set. When several objects or a person and a product appear together, the model may keep or drop some of them (for example a hand holding a product); use roi to restrict the subject area. Parts of a subject hidden behind something else cannot be recovered.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "remove_background"
  }
}

Input Schema

NameRequiredDescriptionDefault
roiNoRegion of interest as 'x1 y1 x2 y2' in px or %, e.g. '20% 10% 80% 95%'. Only the subject inside this box is kept.
cropNoCrop the output to the subject.
sizeNoOutput resolution: preview ≈ 0.25 MP, medium 1.5 MP, hd 4 MP. Use the HTTP API for larger outputs.medium
formatNopng
bg_colorNoOptional background colour, e.g. ffffff or white.
image_urlNoPublic http(s) URL of the source image (max 12 MB).
clean_edgesNoRemove coloured fringes from the old background in hair, fur, and soft edges.
image_base64NoBase64-encoded source image (max 12 MB decoded).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / clean_edges
      Added value: +{
      +  "default": false,
      +  "description": "Remove coloured fringes from the old background in hair, fur, and soft edges.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / roi
      Added value: +{
      +  "description": "Region of interest as 'x1 y1 x2 y2' in px or %, e.g. '20% 10% 80% 95%'. Only the subject inside this box is kept.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Goes beyond the readOnly/openWorld annotations to disclose real model behaviour: it may keep or drop extra objects (e.g. a hand holding a product) and cannot recover occluded parts of a subject. These are useful expectations an agent could not infer from the schema or annotations, though cost, latency, and failure modes are not covered.

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 and input constraint, then output behaviour, then limitations. Four dense sentences with no filler or repetition.

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 and eight parameters, the description supplies the input exclusivity rule, default output semantics, and known accuracy limits. Enums, size tiers, and format defaults live in the schema, so little essential information 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 description coverage is 88%, so parameters are already well documented. The description reinforces roi's purpose and explains the bg_color effect on output, but adds no syntax, formatting, or constraint details absent from 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?

States the verb and resource precisely ('Remove the background from an image and return the cutout') and immediately describes the returned artifact (transparent PNG or subject on solid colour), so an agent knows exactly what the tool produces. It is trivially distinguishable from the only sibling, get_quota.

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?

Gives concrete invocation guidance: exactly one of image_url or image_base64 must be supplied, and roi should be used when multiple objects or a person-plus-product scene risks unwanted dropping. It does not name an alternative tool to prefer, but no comparable alternative exists among the siblings.

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.