Skip to main content
Glama

style_doc_range

Destructive

Apply paragraph and text styles to specific index ranges in a Google Doc, and style multiple ranges in one batched request.

Instructions

Apply paragraph and/or text styles to one or more index ranges in a Google Doc.

Use get_doc_structure to obtain the startIndex and endIndex for each target range. Multiple ranges can be styled in a single call; all batchUpdate requests are sent together.

Args: doc_id: The Google Doc file ID. ranges: List of range dicts. Each dict must include start_index and end_index, plus any combination of the style fields below:

    Paragraph style:
      named_style_type (str): NORMAL_TEXT, HEADING_1 … HEADING_6,
          TITLE, SUBTITLE

    Text style:
      bold (bool), italic (bool), underline (bool), strikethrough (bool)
      font_size (float): size in points
      font_family (str): font family name (e.g. "Courier New", "Consolas")
      foreground_color (dict): {"red": 0-1, "green": 0-1, "blue": 0-1}
      link_url (str | null): set a hyperlink (null to clear)

Returns: Confirmation with docId and count of batchUpdate requests sent.

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": {
      "doc_id": "<doc_id>",
      "ranges": "<ranges>"
    },
    "name": "style_doc_range"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_idYes
rangesYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, so the agent knows this mutates existing content. The description adds that all batchUpdate requests are sent together in one call, which is useful batching context. It does not explain whether existing formatting is overwritten or merged, what permissions are required, or any limit on the number of ranges, so the added behavioral value is moderate.

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-loaded with the one-line purpose, then usage, then a structured Args breakdown that is long but justified because the schema is empty. The Returns section is slightly redundant given an output schema exists, and a couple of lines could be trimmed, but overall it is well organized.

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?

Given a 2-parameter tool with an empty schema, the description supplies the parameter detail, the prerequisite lookup tool, and the batching note, which is nearly everything needed to invoke it. Remaining gaps are mutation semantics (overwrite vs merge) and permissions, which matter for a destructiveHint=true tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the schema itself is a generic array of loose objects, so the description carries the full burden. It documents doc_id and, for each range dict, the required start_index/end_index plus every style field with types and accepted values (named_style_type enumerations, font_size in points, foreground_color RGB 0-1, link_url null to clear). That is meaning the schema does not provide.

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?

States a specific verb and resource ('Apply paragraph and/or text styles to ... index ranges in a Google Doc') and scopes it to index ranges, which implicitly separates it from the sibling style_doc_table_cells. An agent can identify the operation without opening the schema.

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?

Explicitly routes the agent to get_doc_structure to obtain startIndex and endIndex, which is the key prerequisite for calling this tool. It also states that multiple ranges can be handled in one call. It does not say when to prefer this over sibling mutation tools such as write_doc_content, but the guidance it does give is concrete.

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