Skip to main content
Glama

Apply Style

apply_style
Destructive

Apply named paragraph or character styles to Word documents targeting specific ranges or search matches, with automatic backup and safe saved changes.

Instructions

Apply a named style. range={start,end} (locations or bare indices) applies a paragraph style to those paragraphs, changing their full look (Heading1-9 auto-created); target={search:{text, occurrence?}} applies a character style to the matched text instead. For an outline level without visual change use set_paragraph_format. Auto-backup (backup=False skips rotation); atomic validated save. Refuses documents open in Word. For batches, use apply_edits. Defining new named styles lives in the academic pack.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeNo
styleYes
backupNo
targetNo
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.0.0
    • removedInput schema / properties / indices
      Removed value: -{
      -  "items": {
      -    "type": "integer"
      -  },
      -  "type": "array"
      -}
    • addedInput schema / properties / range
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / target
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • changedInput schema / required
      Previous value: -[
      -  "file_path",
      -  "indices",
      -  "style"
      -]New value: +[
      +  "file_path",
      +  "style"
      +]
  2. First observedv1.2.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already mark the tool as destructive (destructiveHint=true). The description adds valuable context beyond that: auto-backup with a skip switch, atomic validated save, and refusal of documents open in Word. This contextualizes the destructive nature and the safety mechanism, though it does not mention error behaviors for missing styles or invalid ranges.

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 description is compact and front-loaded: it states the core action first, then differentiates modes, then gives alternatives and safety notes. Every sentence adds information; none is filler. It is slightly dense but not bloated.

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?

An output schema exists, so return details need not be explained. The description covers both invocation modes, sibling routes, backup behavior, file locking, and atomicity. The only notable gap is the precedence rule when both range and target are supplied, but the conditionals imply mutual exclusivity, making this a minor omission.

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 0%, so the description must carry the semantic burden. It does explain range={start,end} with locations/bare indices, target={search:{text, occurrence?}}, and backup=False skips rotation. file_path and style are not elaborated, but style is effectively 'named style' and file_path is self-evident, so the core parameter meanings are conveyed.

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 opens with a specific verb and resource ('Apply a named style') and immediately distinguishes paragraph-style application via range from character-style application via target. It also names siblings (set_paragraph_format, apply_edits) to differentiate boundaries, so an agent can tell this tool apart without inspecting other schemas.

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 gives explicit when-to-use guidance: use set_paragraph_format for outline levels without visual change, use apply_edits for batches, and use range vs target for paragraph vs character styles. This is direct, actionable routing with no ambiguity left to inference.

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