Skip to main content
Glama

photo_bg_remover

Background Remover — Cut out the subject and remove the background from an existing photo, producing a transparent PNG (or a solid fill color). Edits a user-supplied image; does not generate new imagery. [category: photo]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesJPG, PNG, WebP, BMP (max 20MB)
modelNoSegmentation model; u2net_human_seg is tuned for people. Invalid values fall back to u2net.u2net
bg_colorNoOptional solid background fill color. Default: transparent.
alpha_mattingNoRe-solves hair, fur and glass edges as a soft fade instead of a hard cut. Slower and uses more memory.
alpha_matting_erode_sizeNoWidth of the band around the subject that gets re-solved. Only used when edge softening is on. Values outside 0-64 are pulled back into range.
alpha_matting_background_thresholdNoHow certain a pixel must be to count as definitely background. Only used when edge softening is on. Values outside 0-255 are pulled back into range.
alpha_matting_foreground_thresholdNoHow certain a pixel must be to count as definitely the subject. Only used when edge softening is on. Values outside 0-255 are pulled back into range.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / bg_color / x-ui
      Added value: +{
      +  "unset_label": "Transparent"
      +}
  2. Changed5 schema fields changed
    • addedInput schema / properties / alpha_matting
      Added value: +{
      +  "default": false,
      +  "description": "Re-solves hair, fur and glass edges as a soft fade instead of a hard cut. Slower and uses more memory.",
      +  "title": "Soften the edges",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / alpha_matting_background_threshold
      Added value: +{
      +  "default": 10,
      +  "description": "How certain a pixel must be to count as definitely background. Only used when edge softening is on. Values outside 0-255 are pulled back into range.",
      +  "maximum": 255,
      +  "minimum": 0,
      +  "type": "integer",
      +  "x-show-when": {
      +    "alpha_matting": [
      +      "true"
      +    ]
      +  }
      +}
    • addedInput schema / properties / alpha_matting_erode_size
      Added value: +{
      +  "default": 10,
      +  "description": "Width of the band around the subject that gets re-solved. Only used when edge softening is on. Values outside 0-64 are pulled back into range.",
      +  "maximum": 64,
      +  "minimum": 0,
      +  "type": "integer",
      +  "x-show-when": {
      +    "alpha_matting": [
      +      "true"
      +    ]
      +  }
      +}
    • addedInput schema / properties / alpha_matting_foreground_threshold
      Added value: +{
      +  "default": 240,
      +  "description": "How certain a pixel must be to count as definitely the subject. Only used when edge softening is on. Values outside 0-255 are pulled back into range.",
      +  "maximum": 255,
      +  "minimum": 0,
      +  "type": "integer",
      +  "x-show-when": {
      +    "alpha_matting": [
      +      "true"
      +    ]
      +  }
      +}
    • addedInput schema / properties / model / x-ui
      Added value: +{
      +  "labels": {
      +    "isnet-general-use": "Fine detail (slower)",
      +    "u2net": "Standard",
      +    "u2net_human_seg": "People and portraits"
      +  }
      +}
  3. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations provide little (readOnlyHint=false, destructiveHint=false), so the description carries most of the burden. It discloses the output type (transparent PNG or solid fill) and that it edits an existing image, which is useful. However, it does not mention whether the original file is modified, how long processing takes, or any limitations (e.g., large files). It also does not clarify the response format (e.g., a URL to the result). No contradiction with annotations, but the behavioral detail is thin.

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 sentences, front-loaded with the primary action and output. It includes a useful category tag without fluff. Every sentence earns its place, and the structure is clean and immediately scannable.

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 a moderately complex tool with 7 parameters, the schema handles parameter documentation thoroughly. The description covers the overall purpose, output format, and a key distinction (not generating imagery). However, with no output schema, it would be helpful to explicitly state what the tool returns (e.g., a URL or file path) and whether the original file is preserved. These gaps are minor but prevent a 5. Overall, it is fairly complete for an image-editing tool.

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?

The schema covers 100% of parameters with detailed descriptions, including enums, defaults, and edge-case handling (e.g., 'Invalid values fall back to u2net'). The tool description adds no additional parameter information beyond the schema, which is acceptable given the high coverage. The description's mention of output types is not parameter-specific, so it does not enhance parameter understanding. 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 the tool's function: removing backgrounds from existing photos and producing transparent PNGs or solid fills. It explicitly distinguishes itself from generation tools ('does not generate new imagery'), which separates it from siblings like generate_placeholder_image. The verb 'remove' and resource 'background' are specific, and the category tag further anchors its domain.

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 description states it edits user-supplied images and clarifies it is not for generating new imagery, giving clear context for when to use it. It does not explicitly name alternative tools, but given the sibling list includes many photo editors and generators, the note about not generating imagery effectively excludes those. It could be stronger by mentioning when to choose it over photo_editor or photo_crop, but the core guidance is present.

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.

Resources