Skip to main content
Glama

Ejecutar ExtendScript

ps_execute_script

Execute ExtendScript code in Photoshop to automate app, documents, layers, and Action Manager tasks. Provide a JavaScript function body and return results.

Instructions

Ejecuta código ExtendScript (JS ES3) dentro de Photoshop con acceso total a app, documentos, capas y a las ayudas VZ/U/AM. code es el CUERPO de una función: usa return para devolver datos. Variables: A (args), U (utilidades), AM (Action Manager JSON), VZ.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
codeYes
historyNo
timeoutSecondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/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 add real runtime context: the JS dialect (ES3), that `code` must be a function body that uses `return`, and which helpers are injected (A, U, AM, VZ). It still omits failure/error behavior, default timeout, and the fact that arbitrary code execution is inherently side-effecting.

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 core capability and the function-body contract are front-loaded in the first two sentences, and the variable list is a compact tail. Dense and mostly waste-free, though the trailing 'Variables: ...' fragment could be integrated more cleanly.

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

Completeness3/5

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

For a tool that executes arbitrary code with no annotations, no output schema, and a nested `args` object, the description covers the invocation mechanics well but is silent on timeout defaults, error propagation, and the `history` parameter. Adequate to call it, but not complete enough for a high-risk execution tool.

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 0%, so the description must compensate. It explains `code` (function body, return semantics) and effectively maps `args` to the injected A variable, but leaves `history` and `timeoutSeconds` completely undefined in both schema and description, so two of four parameters remain opaque.

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 (executes) and resource (ExtendScript/JS ES3 code inside Photoshop) with scope ('acceso total a app, documentos, capas'). It is clearly distinct from data-inspection siblings like ps_status or ps_layers, but it never names the closest alternative, ps_run_script_file, so the agent must infer the code-body-vs-file distinction on its own.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the mention of 'acceso total' signals this is the power-user escape hatch, but there is no explicit when-to-use or when-not guidance and no routing to alternatives such as ps_run_script_file, ps_action_manager, or ps_batch. An agent can infer a rough context but not the boundaries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.