Skip to main content
Glama

Set paragraph style in Google Doc

set_paragraph_style
Idempotent

Change any paragraph in a document range to a heading or back to normal text. Restyles whole paragraphs so you can turn a line into a heading without altering its text.

Instructions

Set the named paragraph style — NORMAL_TEXT, TITLE, SUBTITLE or HEADING_1 to HEADING_6 — of every paragraph that overlaps the index range [startIndex, endIndex). Whole paragraphs are restyled even if the range covers only part of one, so a range inside a single line changes just that line’s paragraph. Use it to turn a line into a heading or back into normal text. Get paragraph startIndex/endIndex from get_document’s structure outline or find_text. Does not change text or indexes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
styleYesNamed paragraph style, e.g. HEADING_1 for a top-level heading.
endIndexYesEnd of the range (exclusive); must be greater than startIndex.
documentIdYesThe Google Docs document ID (the part between /d/ and /edit in the document URL). A full Google Docs URL is also accepted.
startIndexYesStart of the range (inclusive). Get exact indexes from get_document or find_text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true, destructiveHint=false and readOnlyHint=false, so safety is covered; the description contributes beyond that by disclosing the non-obvious expansion behavior (whole paragraphs are restyled even for partial ranges) and the guarantee that text and indexes are unchanged. It does not mention revision IDs or response shape, but the key side effect is disclosed.

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?

Four compact sentences, front-loaded with what is set and over what range, then the behavioral caveat, then usage and provenance of indexes. No filler or restatement of the title.

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, the definition covers range semantics, side effects, and index sourcing adequately. The only thin spot is the return payload (e.g., revisionId) and no explicit preconditions such as required scopes, but nothing essential for correct invocation is missing.

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 the baseline is 3, but the description adds genuine semantics the schema lacks: the inclusive/exclusive range boundary plus the paragraph-granularity expansion rule, which is exactly what an agent needs to predict the effect of a partly-covering range. The style and documentId parameters are left to the schema.

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?

Specific verb (set) plus resource (named paragraph style) with the full enum enumerated inline and the affected scope stated as 'every paragraph that overlaps [startIndex, endIndex)'. This clearly separates it from siblings like format_text and set_alignment, which operate on character/alignment attributes rather than named paragraph styles.

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?

Gives concrete usage intent ('turn a line into a heading or back into normal text') and tells the agent where to obtain the indexes (get_document structure outline or find_text), which is real routing guidance. It stops short of an explicit when-not clause naming format_text/set_alignment as the alternatives for non-paragraph styling.

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