Skip to main content
Glama

photoshop_invert_selection

Reverses the active pixel selection so unselected areas become selected and selected areas become unselected, leaving layer pixels unchanged.

Instructions

Invert the current pixel selection: selected pixels become unselected and the rest become selected. Layer pixels are unchanged.

Use when: a selection exists and the user wants the opposite region. Do NOT use when: no selection exists — create one with photoshop_select_rectangle or photoshop_select_all. Do NOT use when: the layer colors should invert — use photoshop_invert.

Returns: confirmation that the selection was inverted. Preconditions: active document and an existing selection. Side effects: selection only. Calling twice restores the original selection. Reversible with photoshop_undo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.

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.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing preconditions (active document plus an existing selection), bounded side effects (selection only), an involution property (calling twice restores the original selection) and reversibility via photoshop_undo. The involution note is important because idempotentHint=false leaves an agent unsure what a repeat call does, and the description resolves that; nothing here contradicts the declared hints.

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 semantic definition, then organized as labeled lines (Use when / Do NOT use when / Returns / Preconditions / Side effects). Every sentence carries distinct information — routing, return value, precondition, reversibility — with no filler.

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?

There is no output schema, so the explicit 'Returns: confirmation that the selection was inverted' covers the return contract, and preconditions/side effects cover the risky parts of a non-read-only call. Nothing an agent needs to invoke this correctly 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 100% and the single document_id parameter is already fully documented (including the null/0 active-document convention), so the description's only added signal is the generic 'active document' precondition. Per the baseline rule for complete schemas, a 3 is appropriate with no compensating param detail needed.

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 precise verb+resource (invert the current pixel selection) and immediately defines the operation's meaning: selected pixels become unselected and the rest become selected. It also explicitly carves out scope ('Layer pixels are unchanged') and names the sibling it must not be confused with (photoshop_invert), so an agent can distinguish it 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?

Contains explicit 'Use when' and two 'Do NOT use when' clauses, each routing to a named alternative (photoshop_select_rectangle, photoshop_select_all for missing selections; photoshop_invert for layer color inversion). This is exactly the when/when-not/alternatives structure that earns the top score.

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