Skip to main content
Glama

photoshop_recipe_remove_background

Removes the background from the active Photoshop document by unlocking the Background layer, running native background removal, falling back to Select Subject or Color Range, with one undo.

Instructions

THE tool for "remove background" / "arka planı sil" / cut out / isolate subject. Call this once and stop. Unlocks a locked Background layer, then runs Photoshop native Remove Background (Select Subject / Color Range only if native is unavailable). One undo reverts everything.

Use when: the user wants the background gone. Hair, busy interiors, product shots — still this tool. Do NOT rasterize, duplicate, hide layers, select_subject, create_layer_mask, or execute_script instead of this recipe.

Returns: { ok, summary, undo_history_states_consumed, details.method = remove_background | remove_layer_background | select_subject | color_range_fallback }.

Preconditions: an active document. Native Remove Background needs a current Photoshop; Select Subject fallback needs PS ≥ 23. Side effects: may unlock/rename the Background layer; attaches a pixel mask; no pixels destroyed; one undo reverts everything.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feather_pxNoEdge feather in pixels (0-20). 0 = hard edge (default for product shots), 1-3 = soft edge for portraits.
document_idYesPhotoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call.
keep_shadowNoReserved for a future iteration; currently recorded in the response but no shadow layer is created yet.
use_generativeNoAfter masking, run generative edge cleanup on inverted background selection (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.7.33
    • changedInput schema / properties / document_id / description
      Previous value: -"Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null to use the active document. A number activates that document before the tool runs."New value: +"Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call."
  2. Changed4 schema fields changedv1.7.32
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / document_id / description
      Previous value: -"Optional Photoshop document id from photoshop_get_state / photoshop_list_documents. When set, the tool activates that document before running so a UI tab switch cannot retarget the edit."New value: +"Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null to use the active document. A number activates that document before the tool runs."
    • changedInput schema / properties / document_id / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • addedInput schema / required
      Added value: +[
      +  "document_id"
      +]
  3. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond annotations: discloses the layer-unlock/rename side effect, the method fallback chain (native → select_subject → color_range), that no pixels are destroyed, that one undo reverts everything, and version preconditions (PS ≥ 23 for fallback). Annotations only carry the generic safety flags; the description carries the real behavioral burden.

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?

Well front-loaded with 'THE tool...' and cleanly sectioned into Use when / Returns / Preconditions / Side effects. Minor redundancy — 'one undo reverts everything' appears twice — keeps it just short of a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, the description spells out the return shape (ok, summary, undo_history_states_consumed, details.method) and enumerates the method values. Preconditions and side effects are both covered, so an agent has everything needed to call and interpret the 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?

Schema coverage is 100% and the schema itself already documents feather_px, document_id, keep_shadow (reserved), and use_generative in detail. The description adds no parameter-level syntax or format guidance beyond the schema, so baseline 3 applies.

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 a specific verb+resource ('Remove Background') with multilingual aliases, and explicitly distinguishes itself from siblings by naming select_subject, create_layer_mask, and execute_script as things NOT to use instead. An agent can identify this as the canonical background-removal recipe without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an explicit 'Use when' condition ('the user wants the background gone') with edge cases (hair, busy interiors, product shots), plus a 'Do NOT ... instead of this recipe' exclusion list naming concrete alternatives. Routing is unambiguous.

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

Deploy Server

Other Tools