Skip to main content
Glama

get_doc_theme

Extract a reusable theme dict from a Google Doc's actual paragraph styles—fonts, colors, and spacing—for apply_theme.

Instructions

Derive a theme dict from a Google Doc's actual paragraph styles.

Scans the document body and reads the style of the first paragraph found for each named style type (NORMAL_TEXT, HEADING_1 through HEADING_6, TITLE, SUBTITLE). Text-level fields (font_family, font_size, bold, italic, color) are the ones every non-empty text run in that paragraph shares, so a bold lead-in isn't reported; paragraph-level fields (line_spacing, space_above, space_below) come from the paragraph's paragraphStyle. A named style type that doesn't appear in the body, or whose first paragraph has no explicit style, is left out.

NORMAL_TEXT's first paragraph is the first of body text: a quote, a rule, a code block or an empty line is skipped, unless the doc has no body text, and then the first of them with text is used. Its space_above and space_below leave out 8pt and 10pt, the spacing a Markdown or HTML write puts around blocks and between paragraphs.

Subsequent paragraphs of the same named style type that differ in style are ignored — they are treated as intentional individual overrides outside the theme.

Use this tool when styles were applied directly to paragraphs (the common case). Use get_doc_named_styles instead when the human explicitly set named style defaults via Format > Paragraph styles > Update X to match in the Google Docs UI. Calling both and comparing results lets you detect whether explicit named styles are in use.

The returned dict is suitable for passing directly to apply_theme.

Args: doc_id: The Google Doc file ID.

Returns: Theme dict keyed by named style type. Empty dict if no explicit paragraph styles are found (e.g. the doc uses purely inherited named style defaults).

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": {
      "doc_id": "<doc_id>"
    },
    "name": "get_doc_theme"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.4/5.0
Behavior3/5

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

Annotations carry only a title, so the description does the heavy lifting, and it does disclose a lot: which fields are intersected across runs, that paragraph-level spacing comes from paragraphStyle, that NORMAL_TEXT skips quotes/rules/code blocks/empty lines, that 8pt/10pt Markdown padding is subtracted, and that later divergent paragraphs are ignored as overrides. That is strong semantic disclosure of what the output means. It doesn't cover operational traits such as permissions or cost of scanning a large doc, so it stops short of a 5.

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?

Front-loaded with the purpose and the sibling routing, and the NORMAL_TEXT edge-case paragraph and override rule each justify their space for correctness. It is dense but somewhat sprawling across five paragraphs, and the Returns section partly restates what the output schema already conveys.

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 read-only derivation tool with a single ID param and an existing output schema, the definition covers the tricky semantics an agent would otherwise get wrong: intersected text fields, excluded Markdown spacing, skipped non-body-text elements, and the empty-dict fallback. Nothing needed to call it or interpret the result 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?

One parameter at 0% schema description coverage, so the description must carry it; 'doc_id: The Google Doc file ID' makes clear this is a Drive file ID rather than a title or URL, which is the meaningful distinction here. It's terse but adequate for a single scalar identifier.

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?

Opens with a precise verb+resource statement: 'Derive a theme dict from a Google Doc's actual paragraph styles,' then enumerates exactly which style types are read (NORMAL_TEXT, HEADING_1-6, TITLE, SUBTITLE). It explicitly contrasts itself with the sibling get_doc_named_styles, so an agent can pick between them without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit when-to-use ('when styles were applied directly to paragraphs (the common case)') and an explicit when-to-use-the-other ('when the human explicitly set named style defaults via Format > Paragraph styles > Update X to match'). It even prescribes a workflow (call both and compare) to disambiguate, which leaves nothing to inference.

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