Google Docs

v1.2.0
io.github.domdomegg/google-documents-mcp Checked 7 hours ago Published 8 months ago

Allow AI systems to read and edit Google Docs.

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

document_get_raw Get document (raw)

Get the full raw JSON structure of a Google Doc, including all tabs, formatting, headers, footers, and styles. Google Docs content is organized under tabs - body content is at tabs[].documentTab.body.content, not at the top level. Warning: responses can be very large. Consider using jq to extract specific fields, or use document_get_text for plain text content.

ParameterTypeDescription
documentId *stringThe ID of the document to retrieve
suggestionsViewModestringThe suggestions view mode to apply to the document

document_get_text Get document text

Get the plain text content of a Google Doc without formatting, including all tabs. Google Docs content is organized under tabs (at tabs[].documentTab.body.content in the raw API), but this tool extracts and flattens the text for you. For very long documents, consider writing output to a file and reading specific sections.

ParameterTypeDescription
documentId *stringThe ID of the document to retrieve

document_create Create document

Create a new blank Google Doc with the specified title.

ParameterTypeDescription
title *stringThe title of the new document

document_batch_update Batch update document

Apply one or more updates to a Google Doc. Supports inserting/deleting text, find/replace, inserting images and tables, managing bullets, and more. All requests are applied atomically - if any fails, none are applied.

document_append Append to document

Append text to the end of a Google Doc. This is a convenience wrapper around batch_update that inserts text at the end of the document body.

ParameterTypeDescription
documentId *stringThe ID of the document to append to
text *stringThe text to append to the end of the document

document_insert Insert into document

Insert text at a specific location in a Google Doc. Use document_get to find the appropriate index. Index 1 is the beginning of the document body.

ParameterTypeDescription
documentId *stringThe ID of the document to insert into
index *numberThe zero-based index where to insert the text. Index 1 is the beginning of the document body (index 0 is reserved).
text *stringThe text to insert
segmentIdstringThe ID of the header, footer, or footnote to insert into. Leave empty for the main body.

document_replace Find and replace in document

Find and replace all occurrences of text in a Google Doc. Returns the number of replacements made.

ParameterTypeDescription
documentId *stringThe ID of the document
findText *stringThe text to search for
replaceText *stringThe text to replace matches with
matchCasebooleanWhether the search should be case-sensitive