Skip to main content
Glama

photoshop_set_text_ranges

Idempotent

Apply mixed fonts, sizes, and colors inside a single Photoshop text layer by setting character ranges, so one layer can hold mixed type or multicolor text.

Instructions

Apply mixed fonts, sizes, and colors inside a single text layer (Action Manager textStyleRange).

Users often say: mixed type, two fonts in one line, multicolor text, 混排, 同一文字层.

Use when: one layer must contain more than one font or color. from is inclusive, to is exclusive (JavaScript slice / ExtendScript string indexes). Do NOT use when: the whole layer shares one style — use photoshop_set_text_style. Do NOT split into extra layers for mixed type unless this tool errors.

Returns: JSON { ok, summary, details: { style, ranges } }. Preconditions: active text layer. Unspecified gaps keep the layer default style. Side effects: rewrites character styles; restores tracking/leading/box afterward.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangesYesNon-overlapping character spans (from inclusive, to exclusive)
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: -[
      -  "ranges"
      -]New value: +[
      +  "ranges",
      +  "document_id"
      +]
  3. Addedv1.7.20

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only supply the generic mutating/idempotent profile; the description adds real behavioral context beyond them: the active-text-layer precondition, that unspecified gaps keep the layer default style, that character styles get rewritten, and that tracking/leading/box are restored afterward. The return shape is also stated despite there being no output schema.

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?

Front-loads purpose, then usage, return, preconditions, and side effects in a scannable order. The multilingual synonym block ('混排', '同一文字层') is slightly noisy but serves intent matching, so it earns its place.

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 2-parameter mutating tool with no output schema and thin annotations, the description covers purpose, routing to the sibling alternative, preconditions, gap behavior, return JSON, and post-call side effects. Nothing needed to invoke it correctly is missing.

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%, so the baseline is 3, but the description adds semantics the schema does not: unspecified gaps inherit the layer default style and index boundaries follow JavaScript/ExtendScript slicing. It does not explain the 64-span cap or what happens to overlapping spans, keeping it short of a 5.

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?

Specific verb+resource: applying mixed fonts/sizes/colors within a single text layer, with the Action Manager mechanism named. It explicitly distinguishes itself from the sibling photoshop_set_text_style, so an agent can tell them apart without opening either schema.

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?

Gives an explicit 'Use when' condition (one layer must contain more than one font or color), an explicit 'Do NOT use when' exclusion routing to photoshop_set_text_style, plus a fallback rule about not splitting layers unless this tool errors. This is exactly the when/when-not/alternative structure.

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