Skip to main content
Glama

photoshop_distort_layer

Pin a layer's bounding box to four target corners for headless perspective or corner-pin distortion, replacing modal Free Transform → Distort. Rasterize Smart Objects first.

Instructions

Corner-pin / perspective distort of a layer: map its bounding box to four target corners (absolute document pixels, clockwise from top-left). Headless replacement for Free Transform → Distort / Perspective Warp (which are modal and cannot be scripted). Implemented as a custom warp mesh fitted to the homography — exact on pixel layers; a Smart Object must be rasterized first (rasterize:true, destructive — duplicate it before if the original matters). Read the current bounds with get_layers / get_state, then compute the target corners. Save a copy of the document before (save_document).

Input Schema

NameRequiredDescriptionDefault
modeNoperspective — true projective mapping (parallel lines converge); bilinear — straight edges, no convergenceperspective
layerNolayer name (searched recursively); default — active layer
cornersYesTarget corners in absolute document px: {"tl":[x,y],"tr":[x,y],"br":[x,y],"bl":[x,y]} or a flat array [x1,y1,x2,y2,x3,y3,x4,y4] (tl,tr,br,bl)
rasterizeNorasterize a Smart Object layer before warping (destructive; required for Smart Objects)
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.
interpolationNobicubic

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.2

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it discloses the custom warp mesh/homography implementation, exactness on pixel layers, and that Smart Objects must be rasterized with rasterize:true, which is destructive and should be preceded by duplication. It also warns to save a copy of the document before running.

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?

The description is a dense paragraph rather than structured bullets, but it front-loads the purpose and every sentence adds operational detail about prerequisites, rasterization, or saving. There is little filler.

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

Completeness4/5

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

For a complex, mutating transform tool with no output schema and no annotations, the description covers the important invocation context: bounds discovery, corner computation, rasterization behavior, and saving a copy. It does not describe return values or failure modes, but is largely complete for correct invocation.

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 83%, so most parameter meaning is already documented in the schema. The description reinforces the coordinate convention and destructive rasterization warning, but does not add much beyond the schema for mode, interpolation, or document_id.

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: corner-pin/perspective distort of a layer, mapping its bounding box to four target corners. This distinguishes it clearly from sibling transform tools such as move, scale, and rotate.

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?

Explains it is a headless replacement for Free Transform -> Distort / Perspective Warp and instructs the agent to read current bounds with get_layers/get_state, compute target corners, and save a copy first. It gives clear usage context, though it does not explicitly name sibling tools or state when not to use it.

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