Skip to main content
Glama

photoshop_select_layer_by_name

Select the active layer by its exact name, including layers inside groups, to apply transforms or property edits. Returns layer info and changes the active layer.

Instructions

Select the active layer by exact name, including layers inside groups.

Use when: a transform or property tool must target a named layer (photoshop_scale_layer, etc.). Do NOT use when: the layer is already active — check photoshop_get_state first.

Returns: selected, layerName, kind, bounds (best-effort), context. First depth-first name match wins when duplicate names exist in different groups. Preconditions: active document. Side effects: changes active layer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesExact layer name (case-sensitive)
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.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It discloses side effects ('changes active layer'), preconditions ('active document'), duplicate-name resolution behavior ('First depth-first name match wins'), and best-effort bounds. It does not mention failure modes (e.g., what happens if the name is not found), which is a minor gap, but the disclosed behaviors are substantial and directly relevant to safe invocation.

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 front-loaded: the core action and scope appear in the first sentence, followed by use/when-not guidance, return summary, and behavioral notes. Every sentence earns its place; there is no filler or repetition of schema content.

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 selection tool with 2 parameters, 100% schema coverage, and no output schema, the description covers the essential context: preconditions, side effects, duplicate-name behavior, and return fields. It does not describe error behavior when the name is not found, which is a meaningful gap for an agent deciding whether to retry or fall back. Still, the description is largely complete for the tool's complexity.

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 schema already documents both parameters. The description adds value by explaining the 'name' parameter's exact-match and case-sensitive semantics (already in schema) and by adding context for document_id: it explains why it exists (to prevent UI tab switch retargeting) and how it relates to sibling tools (photoshop_get_state / photoshop_list_documents). This goes beyond the schema's basic description, so a 4 is warranted.

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 states a specific verb ('Select'), a resource ('active layer by exact name'), and a scope ('including layers inside groups'). It also distinguishes itself from sibling tools by naming the use case (targeting a named layer for transform/property tools) and explicitly naming a sibling (photoshop_scale_layer). This is a clear, specific purpose that an agent can act on.

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?

The description provides explicit when-to-use guidance ('Use when: a transform or property tool must target a named layer') and explicit when-not-to-use guidance ('Do NOT use when: the layer is already active — check photoshop_get_state first'). It also names a concrete alternative (photoshop_get_state) for the exclusion case. This is exactly the kind of routing guidance an agent needs.

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