Skip to main content
Glama

Style text in a doc

set_style

Apply formatting to Google Docs text in place: bold, italic, color, font size, link, alignment, or paragraph spacing. Target a text selection using unique snippets or style the whole document.

Instructions

Apply styling to existing text in place (no content change), the way you select text in Docs and apply formatting. Pick ONE target: from (+ optional to) to style a selection — from the start of the unique from snippet to the end of the unique to snippet (omit to to style just from); or whole_document: true to style the entire doc/tab (e.g. one font throughout, without per-paragraph calls). Styles: bold/italic/underline/strikethrough, color (hex), fontSize (pt), fontFamily, link, paragraph alignment, and paragraph spacing (spaceBefore/spaceAfter in pt, lineSpacing %). Use inspect_style first to read current spacing/fonts. NOTE: a direct style change, not a tracked suggestion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNooptional end anchor: a unique snippet; styles the whole span from the start of `from` to the end of `to` (a selection). Must appear after `from`.
tabNoTarget a specific tab by tabId or title (from list_tabs). Defaults to the first tab.
fromNostart anchor: a unique text snippet to style from (quote a slice from read_doc). Required unless whole_document is set.
styleYesstyles to apply
accountNoGoogle account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account.
documentIdYesGoogle Doc id
whole_documentNostyle the entire document (or tab) instead of a selection — e.g. to set one font throughout. Mutually exclusive with from/to.
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses in-place modification, 'no content change', and that it is 'a direct style change, not a tracked suggestion'. It does not mention permission requirements or exactly how unspecified style fields are handled, but the core behavioral traits are communicated.

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 a single well-structured paragraph that front-loads the core action, then systematically covers selection modes, style options, a pre-step recommendation, and a caveat. Every sentence adds value; there is no fluff or redundancy.

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 mutation tool with no output schema and no annotations, the description covers the primary use cases, selection semantics, style fields, and the direct-change caveat. It omits error behavior for non-unique snippets and doesn't explicitly state partial property application, but overall it is sufficiently complete for correct tool invocation.

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 baseline is 3. The description adds meaningful semantics beyond the schema: it explains the from/to selection span ('from the start of the unique from snippet to the end of the unique to snippet') and clarifies units (pt, %). This makes parameter behavior easier to understand.

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 'Apply styling to existing text in place (no content change)', which is a specific verb+resource+scope statement. It clearly distinguishes set_style from siblings like edit_doc (content edits), get_style (reading), and set_table_style (tables).

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 gives explicit operational guidance: 'Use inspect_style first to read current spacing/fonts' and explains when whole_document is appropriate ('e.g. one font throughout, without per-paragraph calls'). It does not explicitly name sibling alternatives or state when not to use the tool, but the context is 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/dasasian/gdocs-mcp'

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