Skip to main content
Glama

photoshop_crop_document

Destructive

Crop the active Photoshop document to a pixel rectangle, deleting outside pixels and shrinking the canvas. Use when explicit pixel bounds are provided.

Instructions

Crop the active document to a pixel rectangle (left, top, right, bottom). Pixels outside that rectangle are deleted and the canvas shrinks.

Use when: the user gives explicit crop bounds in pixels. Do NOT use when: only one layer should scale inside the existing canvas — use photoshop_fit_layer_to_document or photoshop_scale_layer. Do NOT use when: the whole image should be resampled to a new width and height — use photoshop_resize_image.

Returns: the new document width and height. Preconditions: active document; right > left and bottom > top. Side effects: destructive crop of every layer, one history step. Reversible with photoshop_undo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topYesTop edge position in pixels
leftYesLeft edge position in pixels
rightYesRight edge position in pixels
bottomYesBottom edge position 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. 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 already flag destructiveHint=true and readOnlyHint=false, but the description adds substantial behavioral context: the crop is destructive to every layer, consumes one history step, is reversible via photoshop_undo, and requires right > left and bottom > top. It also states the return values (new width and height).

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 tightly structured with a front-loaded purpose statement followed by labeled sections for usage, returns, preconditions, and side effects. Every sentence carries concrete information about scope, validation, or reversibility.

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 destructive crop tool with no output schema, the description covers the operation, required parameters, validation constraints, side effects, reversibility, and what the tool returns. An agent has everything needed to call it correctly and safely.

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 description coverage is 100%, so the baseline is 3, but the description adds a validation rule not present in the schema ('right > left and bottom > top') and reinforces the pixel-coordinate nature of the rectangle. The schema already documents document_id behavior, so the description does not need to repeat it.

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 and resource ('Crop the active document') plus the exact geometric scope (pixel rectangle left/top/right/bottom) and the consequence (canvas shrinks, outside pixels deleted). It clearly distinguishes itself from sibling operations like fit_layer_to_document, scale_layer, and resize_image.

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 explicit 'Use when' and two 'Do NOT use when' clauses, each naming the correct alternative tool and the condition that selects it. This leaves no ambiguity about when to choose crop versus layer scaling or image resampling.

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