Skip to main content
Glama

Remove a solid image background

remove_background
Read-onlyIdempotent

Remove a solid or near-solid background by flood-filling from the border. color is an optional #rrggbb. The portrait model runs in the browser, not in this handler: MODNet is Apache-2.0, RMBG-1.4 is non-commercial, and the ONNX runtime is too large for the serverless function. Send base64 or a public URL. Private addresses are refused and the decoded file is capped at 10 MB. Returns a PNG as base64.

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": {
      "file": "<file>"
    },
    "name": "remove_background"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe image. Provide url or data.
colorNoBackground color as #rgb or #rrggbb. Blank samples the corners.
featherNo
toleranceNoHow far a border pixel may be from the background color, in RGB distance.

Output Schema

NameRequiredDescriptionDefault
dataYesPNG with transparency as base64.
mimeYes
noteYes
bytesYes
widthYes
heightYes
methodYes
filenameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld, and the description adds real operational constraints beyond them: private addresses are refused (an SSRF guard), decoded payloads are capped at 10 MB, and the result is a PNG in base64. The licensing aside about MODNet and RMBG-1.4 does explain why no ML segmentation happens server-side, which usefully sets expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

Front-loaded and generally dense, but the licensing clause ('MODNet is Apache-2.0, RMBG-1.4 is non-commercial, and the ONNX runtime is too large...') spends a full sentence on license/runtime trivia where a short clause would have conveyed the same limitation to the caller.

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 a nested file object, four parameters and an existing output schema, the description covers what an agent needs before calling: accepted input forms, size ceiling, network restrictions, and the return type. Only feather/tolerance behavior is left entirely to the schema, which is acceptable.

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 75%, so the baseline is 3. The description adds that 'color' is optional and that a blank value implies corner sampling, but it says nothing about feather or tolerance beyond the schema's own wording. Most parameter meaning still comes from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb, resource and mechanism: 'Remove a solid or near-solid background by flood-filling from the border.' The word 'solid' scopes the operation so an agent knows this is not AI subject segmentation. It never names a sibling (crop_image, convert_image) to contrast with, so it lands at clear-but-undifferentiated rather than 5.

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?

Implicit guidance exists: 'solid or near-solid' plus the note that the portrait/MODNet/RMBG models run in the browser imply this tool is unsuitable for photos with complex backgrounds. There is no explicit when-to-use/when-not statement and no alternative tool is named, so the agent must infer the boundary.

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.