Skip to main content
Glama
InDesign MCP Server

InDesign MCP Server

by vinitdeep

apply_style

Apply paragraph or character styles to text matched by plain text or GREP, whole frames/stories, or specific paragraphs; optionally clear hand formatting so the style fully controls the text.

Instructions

Apply a paragraph or character style. Target text by findWhat (plain text or GREP, whole document or one frame), by frameIndex (whole story), or by frameIndex + paragraphIndex. Paragraph styles apply to every paragraph the match touches; character styles apply to exactly the matched text. clearOverrides removes hand formatting so the style fully controls the text. Examples: chapter numbers {type:"paragraph", styleName:"Chapter Number", findWhat:"^Chapter \d+$", useGrep:true}; italics for a book title {type:"character", styleName:"Italic", findWhat:"The Book Title"}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "type": "<type>",
      "styleName": "<styleName>"
    },
    "name": "apply_style"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYes
useGrepNo
findWhatNoText (or GREP if useGrep) to find
pageIndexNo0-based page index for frameIndex
styleNameYes
frameIndexNoLimit to the story of this text frame (with pageIndex)
caseSensitiveNo
clearOverridesNoRemove local (hand) formatting in the targeted text
paragraphIndexNoWith frameIndex and no findWhat: only this paragraph (0-based)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations at all, the description takes on the full disclosure burden and does well: it states that paragraph styles hit every paragraph the match touches while character styles hit exactly the matched text, and it flags that clearOverrides removes hand formatting and defaults to true — an important destructive side effect. Ungapped are failure modes (style not found, no match found) and whether the call is idempotent.

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 targeting rules come first and the destructive clearOverrides behavior is stated in its own sentence, so the piece is front-loaded and readable. The two worked examples are long but earn their space by showing how GREP and character-style targeting actually look.

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 nine-parameter, annotation-free mutation tool with no output schema, the description covers the semantics an agent most needs to call it correctly. Missing pieces are return behavior and error handling when the style name or match resolves to nothing.

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?

At 56% schema coverage across nine parameters, the description compensates by explaining findWhat (plain text vs GREP), frameIndex (whole story), the frameIndex + paragraphIndex combination, and clearOverrides' effect. pageIndex, caseSensitive, and the fact that frameIndex pairs with pageIndex are left to the schema.

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?

The description opens with a specific verb and resource ('Apply a paragraph or character style') and makes the paragraph-vs-character distinction explicit, which implicitly separates it from object-style siblings like apply_object_style. It never names an actual sibling tool, so routing between apply_style, apply_paragraph_style, and apply_object_style still requires inference.

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?

It lays out three concrete targeting modes (findWhat, frameIndex for a whole story, frameIndex + paragraphIndex) and says what each selects, giving clear when-to-use context. There are no explicit exclusions or statements about which sibling to prefer for a given case.

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