Skip to main content
Glama

Format text in Google Doc

format_text
Idempotent

Apply character formatting—bold, italic, underline, strikethrough, font size, family, text or highlight color—to a Google Docs range without changing the text.

Instructions

Apply character formatting to the text in the index range [startIndex, endIndex) of a Google Doc (endIndex is exclusive): bold, italic, underline, strikethrough, fontSize (points), fontFamily (e.g. "Arial", "Roboto") and foregroundColor/backgroundColor (hex such as #1A73E8). Only the properties you pass are changed; all other formatting is kept. Pass false to remove bold, italic, underline or strikethrough. At least one property is required. Get indexes from get_document or find_text (append_text and insert_text also return the range of the new text). Does not change text or indexes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boldNotrue = bold, false = remove bold.
italicNotrue = italic, false = remove italic.
endIndexYesEnd of the range (exclusive); must be greater than startIndex.
fontSizeNoFont size in points (1-400).
underlineNotrue = underline, false = remove underline.
documentIdYesThe Google Docs document ID (the part between /d/ and /edit in the document URL). A full Google Docs URL is also accepted.
fontFamilyNoFont family name as shown in Google Docs, e.g. "Arial" or "Roboto".
startIndexYesStart of the range (inclusive). Get exact indexes from get_document or find_text.
strikethroughNotrue = strikethrough, false = remove strikethrough.
backgroundColorNoHighlight (background) color as hex, e.g. "#FFFF00".
foregroundColorNoText color as hex, e.g. "#1A73E8".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations cover the safety profile (idempotent, non-destructive, open-world), so the bar is lower, yet the description adds real value: only passed properties change, all other formatting is preserved, false removes a boolean style, and "Does not change text or indexes." That partial-update semantics is the key behavior an agent must know and is not in the annotations.

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?

A single dense paragraph that front-loads the action, the range semantics, and the property list before moving to constraints and index sourcing. Every sentence carries information; it is slightly overloaded, which keeps it off a 5.

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?

With no output schema, the description still covers mutation semantics, the at-least-one-property constraint, index sourcing, and that text/indexes are untouched. It omits what the call returns and error behavior for out-of-range indexes, but nothing critical for correct invocation is missing.

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

Parameters3/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 including units, ranges and hex format. The description largely restates this (fontSize in points, hex colors, exclusive endIndex), adding only marginal extra context, so the baseline of 3 applies.

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 ("Apply character formatting") plus resource and scope ("text in the index range [startIndex, endIndex) of a Google Doc"), and enumerates the exact properties it can set. This clearly distinguishes it from siblings like set_paragraph_style and delete_text without opening any 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_document or find_text for indexes and notes that append_text/insert_text return the range of new text, which is exactly the pre-condition an agent needs. It also states "At least one property is required." It does not explicitly name when NOT to use it (e.g., paragraph-level styling belongs to set_paragraph_style), so it stops short of full routing.

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