gogcli-mcp-docs

v4.12.0
io.github.chrischall/gogcli-mcp-docs Checked 5 hours ago Published 22 days ago

Extended Google Docs for Claude via gogcli — auth + full Docs and comments support

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

gog_auth_list

List the Google accounts stored in gogcli, with their scopes. This reads local configuration only — it does not contact Google and does NOT tell you whether an account still works: a signed-out account whose refresh token expired or was revoked is listed here exactly like a healthy one, scopes and all. Use gog_auth_health to check whether an account can actually authenticate.

gog_auth_status

Show gogcli auth CONFIGURATION: keyring backend, credential files, and auth setup. Despite the name this is not a health check — it reads local setup and does not contact Google, so it says nothing about whether an account can still authenticate. Use gog_auth_health for that.

gog_auth_health

Check the LIVE health of each stored Google account. Unlike gog_auth_status (which only reports keyring/config setup), this performs a real token refresh against Google, so it detects expired or revoked (invalid_grant) refresh tokens — the account-wide sign-out that blocks every service. Reports per account: whether the token is currently valid, the mapped cause when it is not, how long ago it was authorized, and a warning as it approaches the 7-day refresh-token limit that applies to OAuth apps whose consent screen is still in "Testing" mode. Run it proactively to re-authorize on your own s…

gog_auth_services

List all Google services supported by gogcli and the OAuth scopes each requires.

gog_auth_add

Authorize a Google account via browser-based OAuth. Opens a browser window where the user must sign in and grant access. Blocks for up to 5 minutes waiting for the user to complete authorization. If the browser does not open automatically, a fallback URL is included in the response. Use gog_auth_list to check which accounts are already configured.

ParameterTypeDescription
email *stringGoogle account email to authorize
extraScopesstringAdditional raw OAuth scope URIs to request, comma-separated, on top of the ones `services` implies. Use for scopes no service covers — e.g. https://www.googleapis.com/auth/bigquery.readonly, require…
servicesstringServices to authorize: "all" or comma-separated list (e.g. "sheets,gmail,calendar"). Default: "docs". Prefer the narrowest set you need — requesting a service whose Google API is not enabled on the…

gog_auth_add_url

Begin REMOTE/headless Google authorization (step 1 of 2). Returns a sign-in URL to open in any browser — no local server or terminal on the gogcli host is needed, so this works on a hosted deployment where the interactive gog_auth_add cannot. Hand the URL to the user; after they sign in, the browser is redirected to a localhost URL that fails to load — that is expected. They copy that full redirected URL (from the address bar) and you pass it to gog_auth_add_complete. The link is valid for 10 minutes. If you pass a custom `services` here, pass the SAME value to gog_auth_add_complete or the…

ParameterTypeDescription
email *stringGoogle account email to authorize
extraScopesstringAdditional raw OAuth scope URIs to request, comma-separated, on top of the ones `services` implies. Use for scopes no service covers — e.g. https://www.googleapis.com/auth/bigquery.readonly, require…
servicesstringServices to authorize: "all" or comma-separated list (e.g. "sheets,gmail,calendar"). Default: "docs". Prefer the narrowest set you need — requesting a service whose Google API is not enabled on the…

gog_auth_add_complete

Complete REMOTE/headless Google authorization (step 2 of 2). Takes the full redirected localhost URL the user copied after finishing gog_auth_add_url, exchanges it for a refresh token, and stores it. Use the SAME `services` value you passed to gog_auth_add_url. Must run within 10 minutes of step 1 and against the same gogcli host.

ParameterTypeDescription
email *stringGoogle account email being authorized (same as step 1)
redirectUrl *stringThe full localhost redirect URL the user copied from the browser address bar after signing in (contains code and state; the page itself fails to load, which is expected).
extraScopesstringExtra OAuth scope URIs — MUST match the value passed to gog_auth_add_url, for the same reason `services` must: the two steps have to describe the same grant.
servicesstringServices authorized — MUST match the value passed to gog_auth_add_url. Default: "docs".

gog_auth_run

Run any gog auth subcommand not covered by the other tools. Run `gog auth --help` for the full list of subcommands, or `gog auth <subcommand> --help` for flags on a specific subcommand. Only these subcommands are available: list, status, services, alias. Flags that override server safety controls (--readonly, --enable-commands, --disable-commands, --account, --access-token, --home, --client, --gmail-no-send, --no-input) and a bare "--" are refused. Local file paths (--out, --out-dir, --attach, --file, --*-file, @file JSON) must be inside GOG_FILE_ROOTS; subcommands that take a local path posit…

ParameterTypeDescription
args *arrayAdditional positional args and flags
subcommand *stringThe gog auth subcommand to run, e.g. "alias", "list", "status"

gog_docs_info

Get Google Doc metadata: title, ID, and other properties.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_cat

Read a Google Doc as plain text.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
chipsbooleanRender Google Docs smart chips (people, dates, rich links) inline in the text output

gog_docs_create

Create a new Google Doc. Returns JSON with the new docId and URL.

ParameterTypeDescription
title *stringTitle for the new document
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_write

Write text content to a Google Doc, replacing existing body content by default. Set append=true to add after existing content.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
text *stringText content to write
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
appendbooleanAppend to existing content instead of replacing (default: false)
batchstringAppend this mutation to a persisted batch (from gog_batch_begin in gogcli-mcp-docs) instead of applying it — nothing changes in the doc until the batch is submitted.
bulletPresetstringWrite a bulleted list with a specific Google Docs bullet glyph preset (e.g. BULLET_DISC_CIRCLE_SQUARE)
bulletsbooleanWrite the paragraphs as a bulleted list with the default disc preset
checkOrphansbooleanBlock the write (exit code 11) if it would orphan an open comment — i.e. remove the text the comment is anchored to. Recommended for replacement writes on commented docs.
indentEndnumberParagraph end indentation in points
indentFirstLinenumberParagraph first-line indentation in points
indentStartnumberParagraph start indentation in points
keepLinesTogetherbooleanKeep all lines of the paragraph on one page/column (true) or clear that setting (false)
keepWithNextbooleanKeep the paragraph with the next paragraph (true) or clear that setting (false)
noBulletsbooleanRemove bullets or numbering from the written paragraphs
orderedbooleanWrite the paragraphs as a numbered list with the default decimal preset
spaceAbovenumberSpace above the paragraph in points
spaceBelownumberSpace below the paragraph in points

gog_docs_find_replace

Find and replace text in a Google Doc.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
find *stringText to find
replace *stringReplacement text
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_structure

Show a Google Doc's structure with numbered paragraphs. Useful for understanding the document layout before making index-based edits.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_run

Run any gog docs subcommand not covered by the other tools. Run `gog docs --help` for the full list of subcommands, or `gog docs <subcommand> --help` for flags on a specific subcommand. Flags that override server safety controls (--readonly, --enable-commands, --disable-commands, --account, --access-token, --home, --client, --gmail-no-send, --no-input) and a bare "--" are refused. Local file paths (--out, --out-dir, --attach, --file, --*-file, @file JSON) must be inside GOG_FILE_ROOTS; subcommands that take a local path positionally (e.g. drive upload) are refused in favour of their dedicated…

ParameterTypeDescription
args *arrayAdditional positional args and flags
subcommand *stringThe gog docs subcommand to run, e.g. "copy", "clear", "insert", "sed", "export"
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_copy

Copy a Google Doc to a new document with the given title.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
title *stringTitle for the new copy
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
parentstringParent folder ID to place the copy in

gog_docs_delete

Delete content within a Google Doc by character index range. To remove the entire document (move to Drive trash), use gog_docs_trash.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and delete that matched range, instead of supplying start/end indices.
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
endnumberEnd index (character position, exclusive). Required unless `at` is set.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
segmentstringTarget an exact header, footer, or footnote segment ID (header/footer IDs come from gog_docs_header_list / gog_docs_footer_list; footnote segment IDs appear in gog_docs_read json mode) instead of the…
startnumberStart index (character position, 1-based). Required unless `at` is set.
tabIdstringTab ID to delete content from (for multi-tab docs)

gog_docs_trash

Move an entire Google Doc to Drive trash. Convenience wrapper around `gog drive delete` so docs-only users can clean up without installing gogcli-mcp-drive. The doc remains recoverable from Drive trash for ~30 days.

ParameterTypeDescription
docId *stringDoc ID to move to trash
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_edit

Edit a Google Doc by finding and replacing text (stream-edit style).

ParameterTypeDescription
docId *stringDoc ID (from the URL)
find *stringText to find
replace *stringReplacement text
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
matchCasebooleanCase-sensitive matching

gog_docs_read

Read the content of a Google Doc. Default: plain text body. Use format="json" for the raw Google Docs API response (lossless, includes character indices needed for index-based gog_docs_insert / gog_docs_delete calls). For markdown output, use gog_docs_export with format="md" — it writes to a file. Use gog_docs_structure to see paragraph-by-paragraph layout with indices.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
allTabsbooleanShow all tabs. In json mode, returns the canonical Document response with all tab content populated.
chipsbooleanRender Google Docs smart chips (people, dates, rich links) inline in text mode; ignored in json mode
formatstringOutput format (default: text)
maxBytesnumberMax bytes to read in text mode (0 = unlimited; default 2000000)
tabstringTarget tab title or ID. In json mode, returns that one tab in the legacy top-level Document shape.

gog_docs_format

Apply text or paragraph formatting to a Google Doc. Use `match` to format a specific text occurrence, `matchAll` to format every occurrence, or omit both to format the whole doc. Boolean flags (bold/italic/etc.) set the attribute; negated flags (noBold/noItalic/etc.) clear it.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
alignmentstringParagraph alignment
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
bgColorstringText background color as #RRGGBB or #RGB
boldbooleanSet bold
bulletPresetstringCreate a bulleted list with a specific Google Docs bullet glyph preset (e.g. BULLET_DISC_CIRCLE_SQUARE)
bulletsbooleanTurn the matched paragraphs into a bulleted list with the default disc preset
codebooleanApply code style (Courier New monospace + grey background)
fontFamilystringFont family (e.g. Arial, Georgia)
fontSizenumberFont size in points
headingLevelintegerSet paragraph named style to HEADING_1..HEADING_6 (shortcut for namedStyle=HEADING_N)
indentEndnumberParagraph end indentation in points
indentFirstLinenumberParagraph first-line indentation in points
indentStartnumberParagraph start indentation in points
italicbooleanSet italic
keepLinesTogetherbooleanKeep all lines of the paragraph on one page/column (true) or clear that setting (false)
keepWithNextbooleanKeep the paragraph with the next paragraph (true) or clear that setting (false)
lineSpacingnumberLine spacing percentage (e.g. 100 for single, 150 for 1.5x, 200 for double)
linkstringSet a hyperlink on the matched text. Accepts http://, https://, mailto:, #bookmarkId, or #heading-slug.
matchstringFormat only the first text match
matchAllbooleanFormat all matches instead of only the first
matchCasebooleanCase-sensitive matching
namedStylestringSet paragraph named style explicitly
noBoldbooleanClear bold
noBulletsbooleanRemove bullets or numbering from the matched paragraphs
noItalicbooleanClear italic
noLinkbooleanClear any hyperlink on the matched text
noStrikethroughbooleanClear strikethrough
noUnderlinebooleanClear underline
orderedbooleanTurn the matched paragraphs into a numbered list with the default decimal preset
segmentstringTarget an exact header, footer, or footnote segment ID (header/footer IDs come from gog_docs_header_list / gog_docs_footer_list; footnote segment IDs appear in gog_docs_read json mode) instead of the…
spaceAbovenumberSpace above the paragraph in points
spaceBelownumberSpace below the paragraph in points
spacingModestringParagraph spacing collapse behavior: NEVER_COLLAPSE always keeps space-above/space-below; COLLAPSE_LISTS collapses spacing between list items
strikethroughbooleanSet strikethrough
tabstringTarget tab title or ID
textColorstringText color as #RRGGBB or #RGB
underlinebooleanSet underline

gog_docs_suggestions_list

List pending suggestions (suggested text insertions and deletions) in a Google Doc, with exact UTF-16 ranges and segment context. Read-only; does not accept or reject suggestions.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTab title or ID (omit for the first tab)

gog_docs_export

Export a Google Doc as PDF, plain text, HTML, DOCX, or other format.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
formatstringExport format: pdf, txt, html, docx, rtf, odt, epub (default: pdf)
outstringOutput file path
overwritebooleanOverwrite the output file if it already exists (gog refuses otherwise)

gog_docs_insert

Insert text at a specific character index in a Google Doc. When `index` is omitted, gog defaults to 1 (the very beginning), NOT the end — sequential inserts without an explicit index produce reversed output. To append at the end of the doc, use gog_docs_append (which uses `gog docs write --append` and is the right tool for iterative document construction). To find a valid index for mid-document inserts, call gog_docs_structure or gog_docs_read first.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and insert at the start of the matched range, instead of computing an index.
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
contentstringText content to insert
filestringPath to a file whose content to insert
indexnumberCharacter index to insert at (1-based; default: 1 = start of doc). Prefer gog_docs_append when you want to add at the end.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
segmentstringTarget an exact header, footer, or footnote segment ID (header/footer IDs come from gog_docs_header_list / gog_docs_footer_list; footnote segment IDs appear in gog_docs_read json mode) instead of the…
tabIdstringTab ID to insert into (for multi-tab docs)

gog_docs_append

Append text to the end of a Google Doc. This is the right tool for iterative document construction — multiple sequential calls produce content in the order they were called. Use gog_docs_insert only when you need to insert at a specific character position. Known markdown=true limitations (tracked upstream): (a) 3+ tables in one call reorders the trailing punctuation of the paragraph before the 3rd table — split into multiple calls with ≤2 tables each (openclaw/gogcli#607); (b) inline **bold** / *italic* / `code` inside table cells renders as literal characters — pre-format cell text se…

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
filestringPath to a text file to append, read on the gog server. gog also accepts "-" for stdin, but this server never writes to gog's stdin, so "-" would hang until the call times out.
markdownbooleanConvert markdown to Google Docs formatting (headings, bold, lists, etc.). See the tool description for known upstream limitations around tables.
tabstringTarget tab title or ID (for multi-tab docs)
textstringText content to append

gog_docs_list_tabs

List all tabs in a Google Doc.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_sed

Stream-edit a Google Doc with sed-like regex expressions (s/find/replace/ syntax).

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
expressionstringSingle sed expression (e.g. "s/old/new/g")
expressionsarrayMultiple sed expressions
filestringPath to a sed script file
tabstringTab name to edit

gog_docs_update

Update a Google Doc — insert or replace text at a specific position.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and replace that matched range, instead of supplying an index or replaceRange.
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
filestringPath to a file whose content to use
indexnumberCharacter index to insert at
markdownbooleanConvert markdown in the text/file to Google Docs formatting (headings, bold, lists, etc.) instead of inserting it literally.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
pagelessbooleanSet document to pageless format
replaceRangestringReplace a UTF-16 Docs API range START:END (e.g. "25:40") instead of inserting at index. The replacement text/file content overwrites the range.
segmentstringTarget an exact header, footer, or footnote segment ID (header/footer IDs come from gog_docs_header_list / gog_docs_footer_list; footnote segment IDs appear in gog_docs_read json mode) instead of the…
tabIdstringTab ID for multi-tab docs
textstringText content to write

gog_docs_comments_list

List comments on a Google Doc. Returns open comments by default; set includeResolved=true to include resolved comments. Set locate=true (or pass tab) to attach each comment's tab and Docs index ranges as location.matches[] plus location.orphaned — that costs one extra document fetch, but only one for the whole listing, where gog_docs_comments_locate costs one per comment. Either flag additionally requires the Docs scope; the plain listing needs only Drive. matches[] always spans every tab, so a quote appearing in two tabs is visible as an ambiguity rather than silently resolved. tab keeps on…

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
allbooleanFetch all pages
includeResolvedbooleanInclude resolved comments (default: false, open only)
locatebooleanAttach each comment's tab and Docs index ranges (location.matches[] + location.orphaned) using one extra document fetch shared across the whole listing
maxintegerMax results
pagestringDeprecated alias for pageToken, accepted so existing callers keep working. Use pageToken — it matches the nextPageToken field in the response.
pageTokenstringCursor for the NEXT page. Pass back the nextPageToken from a previous response verbatim, keeping the query and max identical: call once, then call again with pageToken=<that value>. A response with NO…
sincestringOnly return comments modified at or after this RFC3339 timestamp (e.g. 2026-06-01T00:00:00Z)
tabstringOnly return comments whose quoted text resolves inside this tab (title or ID). Implies locate, and drops orphaned and unquoted comments.

gog_docs_comments_get

Get a single comment by ID, including its replies.

ParameterTypeDescription
commentId *stringComment ID
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_comments_add

Add a comment to a Google Doc. Optionally attach quoted text that appears as the highlighted passage in the Google Docs UI. The Doc's owner and everyone the text +mentions are notified, so this reads the Doc and asks the MCP host to show the user a confirmation prompt with the Doc, the text and who is mentioned first; nothing is posted unless they accept. If the client cannot show that prompt (no MCP elicitation, e.g. claude.ai), a two-step flow applies instead: call WITHOUT confirmToken and nothing is sent or changed — the result has status "confirmation-required", the full preview and a co…

ParameterTypeDescription
content *stringComment text
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
confirmTokenstringONLY for the two-step confirmation fallback (a client without MCP elicitation). The confirmToken from this same tool's phase-1 "confirmation-required" response, passed back ONLY after the user has see…
quotedstringQuoted text to attach to the comment (shown in UIs when available)

gog_docs_comments_reply

Reply to an existing comment on a Google Doc. Everyone on the thread and anyone the reply +mentions is notified, so this reads the Doc and the comment and asks the MCP host to show the user a confirmation prompt with both and the reply first; nothing is posted unless they accept. If the client cannot show that prompt (no MCP elicitation, e.g. claude.ai), a two-step flow applies instead: call WITHOUT confirmToken and nothing is sent or changed — the result has status "confirmation-required", the full preview and a confirmToken. Follow its instruction (by default: show the preview to the user…

ParameterTypeDescription
commentId *stringComment ID to reply to
content *stringReply text
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
confirmTokenstringONLY for the two-step confirmation fallback (a client without MCP elicitation). The confirmToken from this same tool's phase-1 "confirmation-required" response, passed back ONLY after the user has see…

gog_docs_comments_resolve

Resolve a comment (mark as done). Optionally include a closing message.

ParameterTypeDescription
commentId *stringComment ID to resolve
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
messagestringOptional message to include when resolving

gog_docs_comments_delete

Delete a comment from a Google Doc. This action is permanent.

ParameterTypeDescription
commentId *stringComment ID to delete
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_comments_reopen

Reopen a previously resolved comment (flip resolved → open).

ParameterTypeDescription
commentId *stringComment ID to reopen
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_comments_locate

Locate a comment's anchor in a Google Doc — resolves the comment's quoted text to its current Docs API index range, or reports the comment as orphaned if the quote can no longer be found (e.g. the anchored text was edited away). Read-only; useful before an index-based edit near a comment.

ParameterTypeDescription
commentId *stringComment ID to locate
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
matchCasebooleanCase-sensitive matching of the comment quote
normalizeWhitespacebooleanCollapse whitespace while matching the comment quote
tabstringTarget a specific tab by title or ID

gog_docs_find_range

Map literal text in a Google Doc to its Docs API UTF-16 index range(s). Read-only helper for computing the start/end indices that index-based tools (gog_docs_delete, gog_docs_update --replace-range) need. Returns the first match by default; use occurrence to pick a specific one or all to return every match.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
text *stringLiteral text to locate
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
allbooleanReturn all matches instead of just one
failEmptybooleanTreat no matches as an error instead of returning an empty result
matchCasebooleanCase-sensitive matching
normalizeWhitespacebooleanCollapse whitespace while matching
occurrenceintegerReturn the Nth occurrence (1-based; default: first)
segmentstringTarget an exact header, footer, or footnote segment ID (header/footer IDs come from gog_docs_header_list / gog_docs_footer_list; footnote segment IDs appear in gog_docs_read json mode) instead of the…
tabstringTarget a specific tab by title or ID

gog_batch_begin

Open a persisted, revision-locked request batch for a Google Doc. Subsequent docs mutation tools called with batch=<batchId> append their requests locally instead of applying them; gog_batch_end submits everything atomically. Returns the batchId.

ParameterTypeDescription
docId *stringGoogle Doc ID the batch is locked to
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
namestringOptional batch label

gog_batch_end

Submit a persisted batch: applies every composed request to the doc in one atomic batchUpdate against the locked revision. Atomic by default — set autoSplit to submit >500-request batches as ordered chunks (non-atomic), or continueOnError to retry individually after an atomic validation failure, retaining failures in the batch.

ParameterTypeDescription
batchId *stringBatch ID (from gog_batch_begin)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
autoSplitbooleanSubmit batches over 500 requests as ordered chunks (non-atomic)
continueOnErrorbooleanAfter an atomic validation failure, submit requests individually and retain failures

gog_batch_abort

Discard a persisted batch and its composed requests without applying anything to the doc.

ParameterTypeDescription
batchId *stringBatch ID to discard
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_batch_list

List persisted Docs request batches (id, doc, label, request count, status).

ParameterTypeDescription
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_batch_show

Show one persisted batch: its doc, locked revision, and the composed requests awaiting submission.

ParameterTypeDescription
batchId *stringBatch ID
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_batch_prune

Delete stale persisted batches (not updated within olderThan).

ParameterTypeDescription
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
olderThanstringDelete batches not updated within this duration (e.g. 72h, 7d)

gog_docs_table_column_width

Set a fixed width (in points) for a table column, or reset columns to Docs-managed even distribution. Target the table by 1-based index in document order (negative counts from the end) and the column by 1-based number. Pass evenlyDistributed without col to reset every column in the table.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
colinteger1-based column number. Omit with evenlyDistributed to reset all columns.
evenlyDistributedbooleanReset the selected column (or all columns when col is omitted) to Docs-managed equal width.
tabstringTarget tab title or ID
tableIndexinteger1-based table index in document order; negative counts from the end (default: 1)
widthnumberFixed column width in points (minimum 5pt). Mutually exclusive with evenlyDistributed.

gog_docs_table_row_insert

Insert a row into a native Google Docs table, optionally populated from a JSON string array. Inserts before the 1-based position given by `at` (negative counts from the end; "end" appends — the default).

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringInsert before this 1-based row, a negative index from the end, or "end" to append (default: end)
tabstringTarget a specific tab by title or ID
tablestringTable selector: 1-based index (negative from the end), exact first-cell text, * for the only table, or text:VALUE for numeric/syntax-looking first-cell text (default: 1)
valuesJsonstringJSON string array with the new row's cell values, e.g. ["Name","Qty"]

gog_docs_table_row_delete

Delete a row from a native Google Docs table by 1-based row number (negative counts from the end). The row's cell content is lost.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
row *integer1-based row number; negative indexes count from the end
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTarget a specific tab by title or ID
tablestringTable selector: 1-based index (negative from the end), exact first-cell text, * for the only table, or text:VALUE for numeric/syntax-looking first-cell text (default: 1)

gog_docs_table_column_insert

Insert a column into a native Google Docs table. Inserts before the 1-based position given by `at` (negative counts from the end; "end" appends — the default).

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringInsert before this 1-based column, a negative index from the end, or "end" to append (default: end)
tabstringTarget a specific tab by title or ID
tablestringTable selector: 1-based index (negative from the end), exact first-cell text, * for the only table, or text:VALUE for numeric/syntax-looking first-cell text (default: 1)

gog_docs_table_column_delete

Delete a column from a native Google Docs table by 1-based column number (negative counts from the end). The column's cell content is lost.

ParameterTypeDescription
col *integer1-based column number; negative indexes count from the end
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTarget a specific tab by title or ID
tablestringTable selector: 1-based index (negative from the end), exact first-cell text, * for the only table, or text:VALUE for numeric/syntax-looking first-cell text (default: 1)

gog_docs_table_merge

Merge a rectangular cell range in a native Google Docs table. Content of non-first cells in the range is absorbed/discarded by the merge — use gog_docs_table_unmerge to split back.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
range *string1-based cell range r1,c1:r2,c2 (e.g. "1,1:2,3")
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTarget a specific tab by title or ID
tablestringTable selector: 1-based index (negative from the end), exact first-cell text, * for the only table, or text:VALUE for numeric/syntax-looking first-cell text (default: 1)

gog_docs_table_unmerge

Unmerge (split) the merged region containing a given cell in a native Google Docs table.

ParameterTypeDescription
cell *string1-based cell r,c inside the merged region (e.g. "1,1")
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTarget a specific tab by title or ID
tablestringTable selector: 1-based index (negative from the end), exact first-cell text, * for the only table, or text:VALUE for numeric/syntax-looking first-cell text (default: 1)

gog_docs_named_range_create

Create a named range — a durable, tab-aware anchor over a span of document text that survives subsequent edits (unlike raw indices). Anchor by literal text (`at`) or explicit UTF-16 start/end indices. Pair with gog_docs_named_range_replace for repeatable templated updates.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
name *stringUnique named range name
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringCreate the range around this literal matched text, instead of start/end indices
endintegerRange end UTF-16 index (exclusive). Required with start unless `at` is set.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
startintegerRange start UTF-16 index (inclusive). Required with end unless `at` is set.
tabstringTarget a specific tab by title or ID

gog_docs_named_range_list

List named ranges in a Google Doc, optionally filtered by name.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
namestringOnly return ranges with this name
tabstringTarget a specific tab by title or ID

gog_docs_named_range_delete

Delete a named range (the anchor only — the underlying document text is untouched).

ParameterTypeDescription
docId *stringDoc ID (from the URL)
nameOrId *stringNamed range name or ID
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTarget a specific tab by title or ID

gog_docs_named_range_replace

Replace the text inside a named range with new content (inline or from a file), keeping the anchor for future updates — the templated-update workhorse.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
nameOrId *stringNamed range name or ID
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
filestringPath to a file with the replacement text
tabstringTarget a specific tab by title or ID
textstringReplacement text

gog_docs_tables_list

Enumerate the native tables in a Google Doc (dimensions, position) — the index/first-cell-text it reports feeds the `table` selector on the table-row/column/merge tools.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTab title or ID (omit for default)

gog_docs_images_list

Enumerate inline/positioned images in a Google Doc.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTab title or ID (omit for default)

gog_docs_headings_list

Enumerate headings in a Google Doc (a lightweight outline view), optionally filtered to one heading level.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
levelintegerOnly return this heading level (1-6)
tabstringTab title or ID (omit for default)

gog_docs_paragraphs_list

Enumerate paragraphs in a Google Doc with emptiness, text-run ranges, styles, and links — richer than gog_docs_structure when you need per-run detail. Optionally filter to one named style.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
stylestringOnly return this named style (e.g. NORMAL_TEXT or HEADING_2)
tabstringTab title or ID (omit for default)

gog_docs_insert_page_break

Insert a Google Docs page break via InsertPageBreakRequest — the only path for multi-page deliverables (markdown has no page-break construct). Specify `index` for a precise character position, or `atEnd` for end-of-doc.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and insert the page break at the start of the matched range, instead of an index.
atEndbooleanInsert at end-of-doc/tab (mutually exclusive with index)
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
indexintegerCharacter index to insert at (1 = beginning). Omit or use atEnd for end-of-doc.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
tabstringTarget a specific tab by title or ID

gog_docs_page_layout

Toggle the page layout (pageless | pages) of an existing Google Doc. Sibling to the --pageless flag on docs create/write/update for docs that were already created (e.g. by Drive markdown conversion) without the desired layout.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
layoutstringPage layout (default: pageless)
marginBottomstringBottom page margin (points by default; supports pt, in, cm, mm)
marginLeftstringLeft page margin (points by default; supports pt, in, cm, mm)
marginRightstringRight page margin (points by default; supports pt, in, cm, mm)
marginTopstringTop page margin (points by default; supports pt, in, cm, mm)
pageHeightstringPage height (points by default; supports pt, in, cm, mm)
pageSizestringNamed page size preset (only applies in paged layout)
pageWidthstringPage width (points by default; supports pt, in, cm, mm — e.g. "8.5in")

gog_docs_insert_table

Insert a native Google Docs table via InsertTableRequest, bypassing the markdown writer. Use this instead of writing a markdown table when you need precise dimensions or to avoid the markdown writer's table limitations. `valuesJson` is a JSON 2D string array whose dimensions must match rows x cols.

ParameterTypeDescription
cols *integerNumber of columns (>=1)
docId *stringDoc ID (from the URL)
rows *integerNumber of rows (>=1)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atEndbooleanInsert at end-of-doc/tab (mutually exclusive with index)
indexintegerCharacter index to insert at (1 = beginning). Omit or use atEnd for end-of-doc.
tabstringTarget a specific tab by title or ID
valuesJsonstringCell values as a JSON 2D string array; dimensions must match rows x cols when supplied

gog_docs_cell_update

Replace (or append to) the content of a single table cell, addressed by table / row / column — non-destructive to the rest of the table, unlike index-based edits that shift on every change. Provide content inline or read it from contentFile. Note: row/col/tableIndex are 1-based here; the sibling gog_docs_cell_style uses 0-based addressing.

ParameterTypeDescription
col *integer1-based column number
docId *stringDoc ID (from the URL)
row *integer1-based row number
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
appendbooleanAppend inside the cell instead of replacing existing cell content
contentstringReplacement content (omit when using contentFile). Pass an empty string to clear the cell. Large values are written to a temp file and passed to gog as --content-file automatically.
contentFilestringRead replacement content from a file instead of content. Mutually exclusive with content — gog rejects both together.
formatstringContent format (default: markdown)
tabstringTarget a specific tab by title or ID
tableIndexinteger1-based table index in document order; negative counts from the end (default: 1)

gog_docs_cell_style

Apply background color and/or inline text styling (bold, italic, underline, colors) to one or more table cells, addressed by 0-based row/column with optional spans. Sibling to gog_docs_cell_update, which changes cell content rather than styling. Note: row/col/tableIndex are 0-based here; gog_docs_cell_update uses 1-based addressing.

ParameterTypeDescription
col *integer0-based column number
docId *stringDoc ID (from the URL)
row *integer0-based row number
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
backgroundColorstringCell background color as #RRGGBB or #RGB
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
boldbooleanSet cell text bold
borderAllstringAll borders as WIDTH[,COLOR[,SOLID|DOT|DASH]] (e.g. 1pt,#000,DASH)
borderBottomstringBottom border (same format as borderAll); overrides borderAll
borderLeftstringLeft border (same format as borderAll); overrides borderAll
borderRightstringRight border (same format as borderAll); overrides borderAll
borderTopstringTop border (same format as borderAll); overrides borderAll
colSpanintegerNumber of columns to style (default: 1)
contentAlignstringVertical content alignment within the cell
italicbooleanSet cell text italic
paddingAllstringAll cell padding (points by default; supports pt, in, cm, mm)
paddingBottomstringBottom cell padding; overrides paddingAll
paddingLeftstringLeft cell padding; overrides paddingAll
paddingRightstringRight cell padding; overrides paddingAll
paddingTopstringTop cell padding; overrides paddingAll
rowSpanintegerNumber of rows to style (default: 1)
tabstringTarget a specific tab by title or ID
tableIndexinteger0-based table index in document order (default: 0)
textColorstringText color as #RRGGBB or #RGB
underlinebooleanSet cell text underline

gog_docs_insert_image

Insert an image into a Google Doc from a local file or a public HTTPS URL. file: uploaded to Drive, temporarily shared so Docs can fetch it, inserted, then the public permission is revoked. url: inserted directly with no Drive upload or temporary sharing. Replaces placeholder text (at) or appends at end-of-doc. On a hosted deployment, where no path on your machine exists, upload the image with gog_upload_slots and pass blobKeys instead of file.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
afterstringInsert the image immediately after the first literal text match (no text is deleted)
atstringPlaceholder text to replace, or "end" to append (default: end)
beforestringInsert the image immediately before the first literal text match (no text is deleted)
blobKeysarrayHosted deployments: blobKeys from gog_upload_slots for files you have ALREADY PUT to their uploadUrl. This is how to send a file you hold (a photo, a PDF) when this server is remote: no base64 in the…
filestringPNG, JPEG, or GIF image on the gog server to upload and insert (exactly one of file, url or blobKeys)
heightnumberImage height in points (optional; width-only preserves aspect ratio)
namestringOverride the uploaded Drive filename
onRestrictedstringIf public sharing is blocked: error out, or fall back to a linked image (default: error)
parentstringDrive folder ID for the uploaded image
tabstringTarget a specific tab by title or ID
urlstringPublic HTTPS image URL to insert directly — no Drive upload or temporary public sharing (exactly one of file, url or blobKeys)
widthnumberImage width in points (default: 468)

gog_docs_insert_person

Insert a native Google Docs person smart chip (the interactive @-mention chip) for an email address, at a character index or end-of-doc.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
email *stringEmail address for the person chip
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text, delete the match, and insert the person chip there, instead of an index.
atEndbooleanInsert at end-of-doc/tab (mutually exclusive with index)
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
indexintegerCharacter index to insert at. Omit or use atEnd for end-of-doc.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
tabstringTarget a specific tab by title or ID

gog_docs_insert_date_chip

Insert a native Google Docs date smart chip, at a character index or end-of-doc.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atEndbooleanInsert at end-of-doc/tab (mutually exclusive with index)
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
datestringDate to insert as YYYY-MM-DD (default: today)
formatstringDate display format (default: abbreviated)
indexintegerCharacter index to insert at. Omit or use atEnd for end-of-doc.
tabstringTarget a specific tab by title or ID

gog_docs_add_tab

Add a tab to a Google Doc. Tabs partition a doc into independently-addressable sections (multi-tab docs). Optionally set the title, zero-based position, parent tab (for nesting), and an emoji icon.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
iconEmojistringEmoji icon for the tab
indexintegerZero-based tab position within the parent
parentTabstringParent tab title or ID to nest this tab under
titlestringUser-visible tab title

gog_docs_rename_tab

Rename a tab in a Google Doc. Identify the existing tab by title or ID and give it a new title.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
tab *stringExisting tab title or ID to rename
title *stringNew user-visible tab title
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_delete_tab

Delete a tab (and its content) from a Google Doc. Identify the tab by title or ID. This permanently removes the tab and everything in it.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
tab *stringExisting tab title or ID to delete
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_clear

Clear all content from a Google Doc, leaving an empty document. The doc itself is preserved (same ID/URL); only its body content is removed. To delete the whole doc instead, use gog_docs_trash.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.

gog_docs_insert_footnote

Insert a footnote at a character index (or end-of-doc) and populate its text. The footnote reference mark is placed in the body; the footnote content goes in the new footnote segment.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and place the reference mark at the start of the matched range
atEndbooleanTarget end-of-doc/tab (mutually exclusive with index and at)
filestringRead footnote text from a file on the gog server. gog also accepts "-" for stdin, but this server never writes to gog's stdin, so "-" would hang until the call times out.
indexintegerCharacter index to place the reference mark at (1 = beginning). Omit or use atEnd for end-of-doc.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
tabstringTarget a specific tab by title or ID
textstringFootnote text

gog_docs_insert_section_break

Insert a continuous or next-page section break at a character index (or end-of-doc). Section breaks enable per-section layout such as column counts (see gog_docs_section_columns).

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and insert at the start of the matched range
atEndbooleanTarget end-of-doc/tab (mutually exclusive with index and at)
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
indexintegerCharacter index to insert at (1 = beginning). Omit or use atEnd for end-of-doc.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
tabstringTarget a specific tab by title or ID
typestringSection break type (default: next-page)

gog_docs_insert_horizontal_rule

Insert a horizontal rule (paragraph border) at a character index (or end-of-doc).

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and insert at the start of the matched range
atEndbooleanTarget end-of-doc/tab (mutually exclusive with index and at)
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
indexintegerCharacter index to insert at (1 = beginning). Omit or use atEnd for end-of-doc.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
tabstringTarget a specific tab by title or ID

gog_docs_section_columns

Set the column count (1-3) for the document section containing the target position. Use count=1 to reset to a single column. Anchor by index, end-of-doc, or literal text.

ParameterTypeDescription
count *integerNumber of columns (1-3; 1 resets to one column)
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and target the section at the start of the matched range
atEndbooleanTarget end-of-doc/tab (mutually exclusive with index and at)
batchstringAppend this mutation to a persisted batch (from gog_batch_begin) instead of applying it — nothing changes in the doc until gog_batch_end submits the batch.
indexintegerCharacter index identifying the section (1 = beginning). Omit or use atEnd for end-of-doc.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
separatorstringColumn separator line: none or between
tabstringTarget a specific tab by title or ID

gog_docs_header_list

List a Google Doc's headers and their segment IDs. Use a segment ID with the segment param on gog_docs_insert / gog_docs_update / gog_docs_delete / gog_docs_format / gog_docs_find_range to edit inside a header.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringLimit results to a tab title or ID

gog_docs_header_create

Create a header in a Google Doc and optionally populate its initial text. Returns the new header segment ID.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
atstringAnchor by literal text and target the section at the start of the matched range
atEndbooleanTarget end-of-doc/tab (mutually exclusive with index and at)
filestringRead initial header text from a file on the gog server. gog also accepts "-" for stdin, but this server never writes to gog's stdin, so "-" would hang until the call times out.
indexintegerCharacter index identifying the section the header belongs to (1 = beginning). Omit or use atEnd for end-of-doc.
matchCasebooleanCase-sensitive `at` matching
occurrenceintegerUse the Nth `at` match (1-based; required when `at` is ambiguous)
tabstringTarget a specific tab by title or ID
textstringInitial header text

gog_docs_header_delete

Delete a header from a Google Doc by its segment ID (from gog_docs_header_list).

ParameterTypeDescription
docId *stringDoc ID (from the URL)
headerId *stringHeader segment ID (from gog_docs_header_list)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTab title or ID containing the header

gog_docs_replace_image

Replace an existing image in a Google Doc in place — keeping its position and bounds — with a new image from a local file or public HTTPS URL. Target the image by exact object ID (from gog_docs_images_list), by alt-text substring, or leave both off to replace the only image in the doc/tab. On a hosted deployment, where no path on your machine exists, upload the image with gog_upload_slots and pass blobKeys instead of file.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
blobKeysarrayHosted deployments: blobKeys from gog_upload_slots for files you have ALREADY PUT to their uploadUrl. This is how to send a file you hold (a photo, a PDF) when this server is remote: no base64 in the…
filestringPNG, JPEG, or GIF image on the gog server to upload and use (exactly one of file, url or blobKeys)
matchAltstringSelect the image whose alt text contains this value (case-insensitive)
namestringOverride the uploaded Drive filename (file mode)
objectIdstringExact image object ID to replace (from gog_docs_images_list)
parentstringDrive folder ID for an uploaded local image (file mode)
tabstringTarget a specific tab by title or ID
urlstringPublic HTTPS image URL to use directly — no Drive upload (exactly one of file, url or blobKeys)

gog_docs_table_row_pin_header

Pin (or unpin) leading rows of a native Google Docs table as repeating header rows. rows=N pins the first N rows; rows=0 unpins all header rows.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
rows *integerNumber of leading rows to pin as headers; 0 unpins all header rows
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
tabstringTarget a specific tab by title or ID
tablestringTable selector: 1-based index (negative from the end), exact first-cell text, * for the only table, or text:VALUE for numeric/syntax-looking first-cell text (default: 1)

gog_docs_table_row_style

Set native table row height and page-overflow behaviour. Target a 1-based row (negative counts from the end) or omit row to style every row in the table.

ParameterTypeDescription
docId *stringDoc ID (from the URL)
accountstringGoogle account email to use, e.g. you@gmail.com — must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account.
minHeightstringMinimum row height (points by default; supports pt, in, cm, mm)
preventOverflowbooleanKeep the row within one page or column (true) or clear that setting (false)
rowinteger1-based row number; negative indexes count from the end; omit to style all rows
tabstringTarget a specific tab by title or ID
tablestringTable selector: 1-based index (negative from the end), exact first-cell text, * for the only table, or text:VALUE for numeric/syntax-looking first-cell text (default: 1)

gog_upload_slots

HOSTED DEPLOYMENTS: how to give this server a FILE you hold (a photo, a PDF, an .eml). This server runs remotely and cannot read paths on your machine, so call this first with the files' names: it returns one signed upload slot per file. PUT each file's bytes to its uploadUrl (each slot carries a ready `curl` command — replace the <path to …> placeholder; the Content-Type must be exactly the slot's mimeType), then pass the slots' blobKeys in the `blobKeys` parameter of the tool that takes the file: gog_gmail_send, gog_gmail_reply, gog_gmail_reply_all, gog_gmail_drafts_create, gog_gmail_dra…

ParameterTypeDescription
files *arrayOne entry per file: {filename, mimeType?}. The filename is the name the recipient / Drive will show, and its extension is how gog types an attachment — give it the right one.