Skip to main content
Glama

remove_background

Cut subjects out of images to create PNGs with transparent backgrounds. Batch-process up to 64 images, then trim, pad, square, resize, or flatten onto a solid color for compositing.

Instructions

Cut the subject out of one or more images: PNG cut-outs with a transparent background (BiRefNet).

images: 1 to 64 local image paths (PNG, JPEG, WebP, GIF, BMP or TIFF; the first frame of an animation). All are processed in one batch, so the model loads once; pass them together. With no other option each output is the same size as its input, the subject opaque and the background transparent, so it lines up with the original for compositing. trim=True crops to the subject's bounding box, plus padding on every side (a fraction of the subject's longer side, default 0.05; 0 is a tight crop). padding applies only with trim. square=True centres the result on a square transparent canvas (for icons and sprites). size: scale so the longer side is this many pixels (16 to 4096); with square, size x size. background: a colour like "#ffffff" to flatten onto instead of transparency (RGB PNG). Typical calls: UI icon trim=True, square=True, size=256; item sprite trim=True, padding=0; cut-out for compositing: no options. Returns per image the input, the output path, its size and the subject box found (x0, y0, x1, y1 in input pixels, with trim). A second, model free pass does the layout when any option is set. Default output folder: /ai/output/localgen/cutout//.

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

Input Schema

NameRequiredDescriptionDefault
sizeNo
trimNo
imagesYes
squareNo
paddingNo
backgroundNo
output_dirNo
idle_timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

No annotations exist, so the description carries the full load, and it does disclose real behavior: batch-of-up-to-64 processing with a single model load, a second model-free layout pass when options are set, the default output location, and the per-image return payload including the subject box coordinates. It does not mention any backend/GPU prerequisite or failure modes, which is the main remaining gap for a heavy model-backed tool.

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-loads purpose in the first sentence, then one option per line in a scannable structure where each line adds new information. Slightly dense and long, but there is almost no filler; the format list and return-value sentence are dense but earn their space.

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?

For an eight-parameter, no-annotation, no-output-schema tool, the description supplies return shape, default output folder, value ranges, format support, and option interactions. Only idle_timeout_seconds and any execution prerequisites or cost/latency expectations are unaddressed.

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 0%, so the description must document the eight parameters itself, and it covers six of them with real meaning: the images array (count, accepted formats, first-frame-of-animation), size range 16-4096 and square interaction, trim semantics, padding as a fraction of the longer side with default 0.05 and its dependency on trim, and the background colour format. Only output_dir (implied via the default folder path) and idle_timeout_seconds are left unexplained.

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 and resource ('Cut the subject out of one or more images') plus the exact output ('PNG cut-outs with a transparent background') and the underlying model. That is clearly distinguishable from the generate_*/upscale_image siblings, which produce or enlarge images rather than removing backgrounds.

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 when-to-use recipes ('UI icon trim=True, square=True, size=256', 'item sprite trim=True, padding=0', 'cut-out for compositing: no options') and states the batch constraint ('pass them together' because the model loads once). It does not explicitly exclude or contrast with any named sibling, but the intended contexts are unambiguous.

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