Skip to main content
Glama

photoshop_select_rectangle

Create a rectangular pixel selection from corner coordinates to mask, crop, or prepare a layer mask. Set replace, add, subtract, or intersect modes to combine it with the current selection.

Instructions

Create a rectangular pixel selection from corner coordinates.

Use when: masking, cropping a region, or preparing for layer mask. Do NOT use when: subject isolation is needed — use photoshop_recipe_remove_background.

Returns: selection bounds [left, top, right, bottom]. Preconditions: active document. Side effects: replaces, adds, subtracts, or intersects the current selection. mode intersect/add/subtract uses Action Manager and does not depend on the SelectionType enum.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topYesTop edge in pixels
leftYesLeft edge in pixels
modeNoHow this rectangle combines with the current selection. Default replace. Use intersect when SelectionType.INTERSECT is unavailable.
rightYesRight edge in pixels
bottomYesBottom edge in pixels
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"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "left",
      -  "top",
      -  "right",
      -  "bottom"
      -]New value: +[
      +  "left",
      +  "top",
      +  "right",
      +  "bottom",
      +  "document_id"
      +]
  3. Changed1 schema field changedv1.7.20
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "How this rectangle combines with the current selection. Default replace. Use intersect when SelectionType.INTERSECT is unavailable.",
      +  "enum": [
      +    "replace",
      +    "add",
      +    "subtract",
      +    "intersect"
      +  ],
      +  "type": "string"
      +}
  4. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare the generic mutation profile (readOnlyHint=false, destructiveHint=false, non-idempotent). The description goes well beyond that: it states the precondition (active document), the side effect that the current selection is replaced/added/subtracted/intersected, the returned value, and the implementation quirk that add/subtract/intersect modes use Action Manager rather than the SelectionType enum.

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 one-line purpose followed by labelled Use when / Do NOT use / Returns / Preconditions / Side effects blocks. Every sentence carries information an agent needs; nothing is padding.

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?

For a 6-parameter mutation tool with no output schema, the description supplies the missing pieces: return value, preconditions, side effects on existing selection, and the mode caveat. An agent has everything needed to call it correctly.

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 100%, so the schema already documents every parameter and the baseline would be 3. The description adds one genuine clarification beyond the schema for the mode parameter (that add/subtract/intersect bypass the SelectionType enum), which justifies a small bump but no more.

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 (Create), resource (rectangular pixel selection) and method (from corner coordinates), which is enough to distinguish it from photoshop_select_ellipse, photoshop_select_all and photoshop_select_subject among the selection siblings.

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?

Explicit 'Use when' list (masking, cropping a region, preparing for layer mask) plus an explicit 'Do NOT use when' case that names the correct alternative (photoshop_recipe_remove_background for subject isolation). Both the positive and negative routing conditions are stated.

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