Skip to main content
Glama

photoshop_contract_selection

Shrink the active pixel selection inward by a specified pixel amount to tighten loose selections or trim halos after expanding. Requires an existing selection and returns JSON with selection details.

Instructions

Contract (shrink) the active pixel selection inward by a pixel amount.

Use when: tightening a loose selection or trimming halo after expand. Do NOT use when: no selection exists — create one first.

Returns: JSON { ok, summary, details: { pixels, bounds?, context } }. Preconditions: active document and active pixel selection. Side effects: modifies selection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pixelsYesPixels to contract by (minimum 1)
document_idNoOptional 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.

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 are present, so the description carries the behavioral disclosure burden. It compensates well by stating preconditions (active document and active pixel selection), side effects (modifies selection), and the return shape. It doesn't describe failure behavior or reversibility, but the core mutation semantics are disclosed.

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 compact and well-structured, with scannable sections for operation, usage, returns, preconditions, and side effects. Every sentence adds useful information and there is 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?

For a 2-parameter selection mutation with no annotations and no output schema, the description covers preconditions, side effects, return format, and use context. An agent has enough information to call it correctly and interpret the result.

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 both parameters already have clear descriptions in the schema. The description adds only the phrase 'pixel amount' and reuses 'pixels' in the return shape, so this is the baseline-3 case where the schema does the heavy lifting.

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 opens with a specific verb and resource: 'Contract (shrink) the active pixel selection inward by a pixel amount.' This unambiguously identifies the operation and distinguishes it from sibling selection tools like expand, feather, or select_rectangle.

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 gives explicit 'Use when' contexts (tightening a loose selection, trimming halo after expand) and a clear 'Do NOT use when' precondition (no selection exists). It stops short of naming an alternative tool such as photoshop_expand_selection, so it doesn't fully satisfy the alternatives criterion.

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