docs_add_tab
Adds a named tab to a Google Doc and writes formatted content including headings, paragraphs, tables, callouts, and images.
Instructions
Adds a new named tab to an existing Google Doc and writes formatted content.
The service account must have Editor access to the target document.
doc_id: Google Doc ID (from the URL: /document/d//edit) tab_title: Title shown on the tab blocks: JSON array of content blocks. Supported types:
{"type": "h1", "text": "Title"} {"type": "h2", "text": "Section"} {"type": "h3", "text": "Subsection", "space_above": 18} {"type": "p", "text": "Body paragraph text"} {"type": "p", "text": "Bold label", "bold": true, "space_above": 8} {"type": "p", "text": "Evidence citation", "italic": true} {"type": "p", "text": "Strong", "color": [0.1, 0.55, 0.15]} {"type": "callout", "text": "Warning text", "bg_color": [1.0, 0.98, 0.8], "bold": true} {"type": "bullet", "text": "Bullet point text"} {"type": "spacer"} {"type": "image", "drive_file_id": "1abc...", "width": 450, "height": 280} {"type": "image", "uri": "https://.../img/", "width": 450, "height": 280} -- uri: use the URL returned by POST /img/upload on the MCP server {"type": "table", "headers": ["Col A", "Col B", "Col C"], "rows": [["val1", "val2", "val3"], ...], "header_color": [0.18, 0.42, 0.70]}
Flags for p blocks: bold (bool), italic (bool), color ([r,g,b] 0-1 floats), space_above (pt) Flags for h1/h2/h3: space_above (pt) callout bg_color presets: warning=[1.0,0.98,0.8], info=[0.88,0.94,1.0], success=[0.9,0.97,0.9]
Returns the tab_id and a link to the document.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blocks | Yes | ||
| doc_id | Yes | ||
| tab_title | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |