Skip to main content
Glama

Style a text range

style_text
DestructiveIdempotent

Change the style of any text range in a Google Doc: bold, italic, underline, color, font, links, superscript/subscript, using start and end indexes. Only the specified formatting is updated.

Instructions

Applies character formatting to [start_index, end_index): bold, italic, underline, strikethrough, small_caps, font_size (points), font_family (e.g. "Roboto"), foreground_color/background_color (6-digit hex), link_url (empty string removes an existing link) and baseline_offset (superscript/subscript/none). Only the provided fields change (the fields mask is computed); at least one is required. Explicit false turns a toggle off. Get indexes from read_document_text. Styling does not shift indexes, so several style calls can safely reuse the same coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boldNoBold on/off.
italicNoItalic on/off.
tab_idNoTab to target (from list_tabs). Omit for the first/only tab.
link_urlNoTurn the range into a link to this URL; empty string removes an existing link.
end_indexYesEnd of the range to style (exclusive).
font_sizeNoFont size in points.
underlineNoUnderline on/off.
segment_idNoHeader/footer/footnote segment id (from get_document). Omit for the document body.
small_capsNoSmall caps on/off.
document_idYesThe document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output.
font_familyNoFont family name, e.g. "Roboto".
start_indexYesStart of the range to style (inclusive).
strikethroughNoStrikethrough on/off.
baseline_offsetNoVertical offset of the text.
background_colorNoText highlight color, e.g. "#ffff00".
foreground_colorNoText color, e.g. "#1a73e8".
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true, idempotentHint=true), the description reveals critical behaviors: partial-update masking, explicit false turning toggles off, empty link_url removing existing links, and index stability across calls. These details materially help an agent predict side effects and reuse the tool safely.

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 first sentence states the operation and enumerates formatting options; the following sentences each add a distinct behavioral constraint. No sentence is filler, and the density is justified by the tool's 16-parameter surface.

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 complex, high-parameter mutation tool with no output schema, the description is remarkably complete: it covers all formatting fields, partial-update semantics, toggle behavior, link removal, index sourcing, and index stability. The only omission, the exact return value, is not essential for a write-oriented tool and is not promised by the annotations.

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 every parameter's format and meaning. The description adds valuable semantic context on top: the fields-mask behavior, the meaning of explicit false for boolean toggles, and the empty-string behavior for link_url. This goes beyond the baseline but is not exhaustive for all 16 parameters.

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 action ('Applies character formatting') on an explicit resource (a text range given by start/end indexes) and enumerates the exact formatting dimensions it affects. This clearly distinguishes it from sibling tools like style_paragraph, which targets paragraph-level formatting.

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?

The description gives concrete usage guidance: obtain indexes from read_document_text, and multiple style calls can reuse the same coordinates because styling does not shift indexes. It also explains the partial-update semantics ('Only the provided fields change') and the requirement that at least one field be provided. It does not explicitly contrast this tool with style_paragraph or other siblings, but the character-range scope makes the intended use clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/A1-x-Tech/mcp-google-docs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server