Skip to main content
Glama

ps_execute_script

Run custom ExtendScript inside Photoshop and return its result for tasks no built-in operation covers. Use an explicit return to pass data back.

Instructions

Run arbitrary ExtendScript in Photoshop and return its result. Use only when no ps_do operation covers the task. The code runs inside a function: use an explicit return to pass data back (objects are serialized); a bare trailing expression returns undefined.

Input Schema

NameRequiredDescriptionDefault
scriptYesExtendScript (ES3) source; end with `return …`

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.2

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose genuinely non-obvious behavior: the code is wrapped in a function, an explicit `return` is required, results are serialized, and a bare trailing expression yields undefined. What it omits is the safety profile of arbitrary code execution — no mention of side effects, document mutation risk, error propagation, or any sandbox/rate constraints.

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?

Three short sentences, zero filler. The core capability is front-loaded, the routing constraint follows, and the return-value mechanics are last — a sensible order for an agent reading top-down.

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?

There is no output schema, so the description correctly spends effort explaining return/serialization semantics. For a single-parameter, side-effect-capable escape hatch it is nearly sufficient; only failure modes and the distinction from photoshop_execute_script remain unaddressed.

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% and the single parameter is documented as ES3 source that must end in `return`. The description adds meaning beyond that schema text by explaining why the return is required (function wrapping) and how objects come back (serialized), which is real value over 'end with return …'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'Run arbitrary ExtendScript in Photoshop and return its result' — and explicitly fences itself against the high-level ps_do router. It does not, however, differentiate itself from the near-identically named sibling photoshop_execute_script, which leaves a real ambiguity an agent cannot resolve from the text alone.

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?

'Use only when no ps_do operation covers the task' gives a clear when-to-use plus the named alternative, which is exactly the routing decision an agent needs given the large sibling list. It stops short of naming ps_catalog as the discovery path or clarifying the boundary with photoshop_execute_script.

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