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
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||