Skip to main content
Glama

getFormatting

Retrieves text and paragraph styling for a Google Docs range or matched text, returning per-run fonts, colors, bold/italic plus alignment, headings, spacing and indentation.

Instructions

Returns the text styling (bold, italic, font, colors, etc.) and paragraph styling (alignment, headings, spacing, indentation) for a specific range or found text in a Google Doc. Returns per-run text styles and per-paragraph styles, so mixed formatting (e.g. bold + italic spans) is fully represented.

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": {
      "documentId": "<documentId>",
      "target": "<target>"
    },
    "name": "getFormatting"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdNoThe ID of the specific tab to read from. If not specified, reads from the first tab.
targetYesTarget by range indices or text search.
documentIdYesThe document ID — the long string between /d/ and /edit in a Google Docs URL.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose the return shape ('per-run text styles and per-paragraph styles') and explains why mixed formatting is fully represented, which is genuinely useful; however, it says nothing about error behavior when textToFind is absent or ambiguous, nor about authorization requirements for reading a document.

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?

Two sentences, front-loaded with the core purpose, and the second sentence earns its place by explaining the per-run granularity that makes mixed formatting visible. Minor redundancy in repeating 'Returns ... styling' twice keeps it just short of ideal.

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 three parameters, full schema coverage, no annotations, and no output schema, the description does the important remaining work: it explains what the response contains at the run and paragraph level. The notable gap is failure behavior for text searches that find nothing or match multiple times.

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 documentId, tabId, and both target variants including 1-based inclusive/exclusive index semantics and matchInstance behavior. The description adds no parameter-level detail beyond restating that the target may be a range or found text, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Returns the text styling ... and paragraph styling ... in a Google Doc') and scopes it to 'a specific range or found text'. The read-oriented wording ('Returns') implicitly separates it from mutation siblings like applyParagraphStyle or copyFormatting, but no sibling is named explicitly, so differentiation is inferred rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the phrase 'for a specific range or found text' tells the agent the two supported targeting modes, which the schema already encodes. There is no explicit guidance on when to prefer this over copyFormatting or addConditionalFormatting, and no statement of preconditions or exclusions.

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