mewcp-google-docs MCP Server
Provides tools for reading, editing, formatting, and reviewing Google Docs documents via the Google Docs API, including text, tables, images, headers, footers, tabs, comments, suggestions, and atomic batch updates.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Read, write and review Google Docs from your AI agent
A Model Context Protocol (MCP) server that exposes Google Docs' API for reading documents, editing text, tables, images, headers, footers and tabs, and managing comments and suggestions.
Overview
The mewcp-google-docs MCP Server provides index-precise, single-purpose editing tools over the Google Docs API:
Read a document as full structural JSON, or as a compact per-tab text rendering with the UTF-16 indexes every edit tool needs
Insert, delete, replace and style text and paragraphs, build lists, and add page breaks, tables, inline images, headers, footers and tabs
Add, reply to, resolve, edit and delete comments, make edits as suggestions, and accept or reject suggestions
Apply several raw
batchUpdaterequests atomically when no single-purpose tool fits
Perfect for:
Drafting and filling in documents from templates (create, insert, replace all placeholders)
Reviewing documents: leaving comments, proposing changes as suggestions, and accepting or rejecting them
Restructuring and formatting existing documents: headings, lists, tables, tabs, headers and footers
Related MCP server: Google Docs MCP
Tools
Gets the latest version of a Google Docs document and returns the full structural JSON: documentId, title, revisionId, and every tab (child tabs nested under childTabs) with its body content, element start/end indexes, styles, headers, footers, inline objects and lists. Comment and suggestion threads are included only with comments_view_mode COMMENTS_VIEW_MODE_INCLUDED, which needs suggestions_view_mode SUGGESTIONS_INLINE. The output is large; use get_document_text to locate edit positions. The document ID is the Drive file ID; the Docs API has no list or search, so find IDs with Drive tools.
Inputs:
- `document_id` (string, required) — The ID of the document to retrieve. Same as the Drive file ID.
- `include_tabs_content` (boolean, optional, default: true) — When true, content for every tab populates `tabs`. When false, only the first tab's content is returned in the legacy top-level `body` / `headers` / `footers` fields and `tabs` is empty. Defaults to true (the provider default is false).
- `suggestions_view_mode` ("DEFAULT_FOR_CURRENT_ACCESS" | "SUGGESTIONS_INLINE" | "PREVIEW_SUGGESTIONS_ACCEPTED" | "PREVIEW_WITHOUT_SUGGESTIONS", optional, default: "DEFAULT_FOR_CURRENT_ACCESS") — How suggestions are shown: inline, previewed as accepted, or previewed as rejected. Indexes differ between modes, so read in the mode the edits will target; edits must be based on SUGGESTIONS_INLINE. Defaults to DEFAULT_FOR_CURRENT_ACCESS.
- `comments_view_mode` ("COMMENTS_VIEW_MODE_UNSPECIFIED" | "COMMENTS_VIEW_MODE_DEFAULT_FOR_CURRENT_ACCESS" | "COMMENTS_VIEW_MODE_OMITTED" | "COMMENTS_VIEW_MODE_INCLUDED", optional, default: "COMMENTS_VIEW_MODE_OMITTED") — Whether comment and suggestion threads are returned. Any value other than the default needs include_tabs_content=true. COMMENTS_VIEW_MODE_INCLUDED needs suggestions_view_mode SUGGESTIONS_INLINE. COMMENTS_VIEW_MODE_DEFAULT_FOR_CURRENT_ACCESS needs suggestions_view_mode SUGGESTIONS_INLINE or DEFAULT_FOR_CURRENT_ACCESS. Defaults to COMMENTS_VIEW_MODE_OMITTED.Output data schema:
{
documentId: string;
title: string | null;
revisionId: string | null;
suggestionsViewMode: string | null;
commentsViewMode: string | null;
tabs: TabData[];
comments: {
commentId: string | null;
status: string | null;
plainTextQuote: string | null;
headPost: {
postId: string | null;
content: string | null;
} | null;
replies: {
postId: string | null;
content: string | null;
}[];
}[] | null;
suggestions: {
suggestionId: string | null;
status: string | null;
summaryText: string | null;
}[] | null;
}
type TabData = {
tabProperties: {
tabId: string | null;
title: string | null;
index: number | null;
parentTabId: string | null;
nestingLevel: number | null;
} | null;
childTabs: TabData[];
documentTab: {
body: Record<string, any> | null;
headers: Record<string, Record<string, any>> | null;
footers: Record<string, Record<string, any>> | null;
inlineObjects: Record<string, Record<string, any>> | null;
lists: Record<string, Record<string, any>> | null;
} | null;
};Returns a compact text rendering of a Google Docs document for locating edit positions, instead of the full structural JSON: per tab (child tabs listed right after their parent), every paragraph's text with its UTF-16 startIndex/endIndex, named style, list ID and, inside tables, the table start index and row/column; plus each table's start index and size, and header/footer text with their IDs. Non-text elements (images, page breaks, smart chips) appear as U+FFFC characters so startIndex plus the offset in text is the document index. Also returns revisionId to pass as required_revision_id on edits. Indexes differ between suggestion view modes, so read in the mode the edits will target. The document ID is the Drive file ID; the Docs API has no list or search, so find IDs with Drive tools.
Inputs:
- `document_id` (string, required) — The ID of the document to retrieve. Same as the Drive file ID.
- `tab_id` (string, optional) — Return only this tab and its child tabs. Omit to return all tabs. An unknown ID returns an error listing the available tab IDs.
- `suggestions_view_mode` ("DEFAULT_FOR_CURRENT_ACCESS" | "SUGGESTIONS_INLINE" | "PREVIEW_SUGGESTIONS_ACCEPTED" | "PREVIEW_WITHOUT_SUGGESTIONS", optional, default: "DEFAULT_FOR_CURRENT_ACCESS") — How suggestions are shown: inline, previewed as accepted, or previewed as rejected. Indexes differ between modes, so read in the mode the edits will target. Defaults to DEFAULT_FOR_CURRENT_ACCESS.Output data schema:
{
documentId: string;
title: string | null;
revisionId: string | null;
tabs: {
tabId: string | null;
title: string | null;
parentTabId: string;
paragraphs: {
startIndex: number;
endIndex: number;
text: string;
style: string | null;
listId?: string;
tableStartIndex?: number;
rowIndex?: number;
columnIndex?: number;
}[];
tables: {
startIndex: number;
rows: number;
columns: number;
}[];
headers: {
headerId: string;
text: string;
}[];
footers: {
footerId: string;
text: string;
}[];
}[];
}Creates a blank Google Docs document with the given title and returns its documentId, title, revisionId and tab IDs. Only the title is set; any other content is ignored, so add content afterwards with the edit tools using the returned documentId.
Inputs:
- `title` (string, required) — The title of the document.Output data schema:
{
documentId: string;
title: string | null;
revisionId: string | null;
tabs: {
tabProperties: {
tabId: string | null;
title: string | null;
} | null;
}[];
}DESTRUCTIVE — REQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. Applies a list of raw Docs API batchUpdate requests to a document in one atomic call; the requests can delete or overwrite any content, tabs, headers, footers, comments or styles. Every request is validated first: if any is invalid the whole batch fails and nothing is applied. Removed or overwritten content is not returned and cannot be restored through this server, only by hand from the document's version history. Returns documentId, replies (one per request, in order), writeControl, suggestionResponses and commentUpdateState. Use the single-request tools for one edit; use this for several edits that must land together or for request types without their own tool (named ranges, section breaks, footnotes, smart chips, dropdowns, positioned objects). Order requests by descending index so earlier edits do not shift later indexes. With write_mode SUGGEST the batch fails if it contains addDocumentTab, createNamedRange, deleteFooter, deleteHeader, deleteNamedRange, deleteTab, updateDocumentTabProperties or updateTableColumnProperties. Writes are limited to 60 per minute per user (429 when exceeded). NEVER call this tool autonomously or as part of an automated flow. You MUST stop, tell the user exactly what the requests will change or delete and that it cannot be undone through this server, and wait for their explicit written confirmation before proceeding.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `requests` (object[], required) — Updates to apply, in order. Each item is one Request object with exactly one request-type key, e.g. {"insertText": {"location": {"index": 1}, "text": "Hi"}}. Schema per type: https://developers.google.com/workspace/docs/api/reference/rest/v1/documents/request
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the updates as normal edits; SUGGEST applies them as suggestions. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the batch fails with 400 instead of applying. Omit to skip the check. Set at most one of required_revision_id / target_revision_id.
- `target_revision_id` (string, optional) — Revision ID the requests were written against; collaborator changes made since are merged with these requests by the Docs server. Valid only for recent revisions (usually a few minutes); too old a revision fails with 400. Omit for no merging. Set at most one of required_revision_id / target_revision_id.Output data schema:
{
documentId: string;
replies: Record<string, any>[];
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
commentUpdateState: string | null;
}Inserts text at a UTF-16 index, or at the end of the body, a header, footer or footnote with at_end, and returns the batch update reply (documentId, writeControl, replies, suggestionResponses). Text must go inside an existing paragraph, so it cannot be inserted at a table's start index. A newline starts a new paragraph that copies the current paragraph's style, including bullets; control characters U+0000-U+0008 and U+000C-U+001F and private-use characters U+E000-U+F8FF are stripped. Inserting shifts the indexes of everything after it, so for several edits work from the highest index down. NOTE: this changes the document's content at that position. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `text` (string, required) — The text to insert. A newline character creates a new paragraph.
- `index` (integer, optional) — Zero-based insertion index, in UTF-16 code units, relative to the segment (from get_document_text or get_document). Set exactly one of `index` / `at_end`.
- `at_end` (boolean, optional, default: false) — Insert at the end of the segment (immediately before its last newline) instead of at `index`. Set exactly one of `index` / `at_end`.
- `tab_id` (string, optional) — ID of the tab the location is in. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote the location is in. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}DESTRUCTIVE — REQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. Permanently deletes the content between start_index and end_index (UTF-16, end exclusive) in a tab's body, header, footer or footnote, and returns the batch update reply. Deleting across a paragraph boundary merges the two paragraphs, which can change paragraph styles, lists, positioned objects and bookmarks. Not allowed: one code unit of a surrogate pair; the last newline of a body, header, footer, footnote, table cell or table of contents; the start or end of a table, table of contents or equation without the whole element; the newline before a table, table of contents or section break without the element; or individual table rows or cells (use delete_table_row / delete_table_column). Content inside a table cell can be deleted. The deleted content is not returned and cannot be restored through this server, only by hand from the document's version history. NEVER call this tool autonomously or as part of an automated flow. You MUST stop, tell the user exactly which text and content in which range will be deleted and that it cannot be undone through this server, and wait for their explicit written confirmation before proceeding.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `start_index` (integer, required) — Zero-based start index of the range, in UTF-16 code units, relative to the segment (from get_document_text or get_document).
- `end_index` (integer, required) — Zero-based end index of the range, exclusive, in UTF-16 code units.
- `tab_id` (string, optional) — ID of the tab that contains the range. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the range. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}DESTRUCTIVE — REQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. Replaces every match of find_text (substring by default, optionally case-sensitive or a regular expression) with replace_text across all tabs, or only the given tab_ids, and returns occurrencesChanged with the batch update reply. Matches by text, so it needs no prior read of the document. Every match is overwritten in one call; the replaced text is not returned and cannot be restored through this server, only by hand from the document's version history. NEVER call this tool autonomously or as part of an automated flow. You MUST stop, tell the user exactly what text will be replaced, with what, in which tabs, and how matching works (case and regex) and that it cannot be undone through this server, and wait for their explicit written confirmation before proceeding.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `find_text` (string, required) — The text (or regular expression, with search_by_regex) to search for.
- `replace_text` (string, required) — The text that replaces each match.
- `match_case` (boolean, optional, default: false) — True for a case-sensitive search. Defaults to false.
- `search_by_regex` (boolean, optional, default: false) — True to treat find_text as a regular expression; escape backslashes in the pattern. Defaults to false (plain substring match).
- `tab_ids` (string[], optional) — Tab IDs to replace in. Omit to replace in all tabs; in a single-tab document a provided ID must match that tab.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
occurrencesChanged: number | null;
}Updates the character style (bold, italic, underline, strikethrough, small caps, font size, font family and weight, text and background color, link, superscript/subscript) of a UTF-16 index range and returns the batch update reply. Only the style params you set are changed; others keep their current value. If the range fully contains a list paragraph, its bullet gets the same style. Clearing a style back to its default is not supported here; use batch_update_document. NOTE: this overwrites the set style properties on the range. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `start_index` (integer, required) — Zero-based start index of the range, in UTF-16 code units, relative to the segment (from get_document_text or get_document).
- `end_index` (integer, required) — Zero-based end index of the range, exclusive, in UTF-16 code units.
- `tab_id` (string, optional) — ID of the tab that contains the range. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the range. Omit for the document body.
- `bold` (boolean, optional) — Whether the text is bold. Omit to leave unchanged.
- `italic` (boolean, optional) — Whether the text is italic. Omit to leave unchanged.
- `underline` (boolean, optional) — Whether the text is underlined. Omit to leave unchanged.
- `strikethrough` (boolean, optional) — Whether the text is struck through. Omit to leave unchanged.
- `small_caps` (boolean, optional) — Whether the text is in small capital letters. Omit to leave unchanged.
- `font_size_pt` (number, optional) — Font size in points. Omit to leave unchanged.
- `font_family` (string, optional) — Font family from the Docs Font menu or Google Fonts; an unrecognized name renders as Arial. Omit to leave unchanged.
- `font_weight` (integer, optional) — Font weight, a multiple of 100 from 100 to 900 (400 is normal). Needs font_family. Bold text with weight below 400 renders at 400, and at 400-699 renders at 700. Omit to leave unchanged.
- `foreground_color` (string, optional) — Text color. Hex color `#RRGGBB`, converted to RGB values from 0.0 to 1.0. Omit to leave unchanged.
- `background_color` (string, optional) — Text highlight (background) color. Hex color `#RRGGBB`, converted to RGB values from 0.0 to 1.0. Omit to leave unchanged.
- `link_url` (string, optional) — External URL to link the text to. Omit to leave unchanged.
- `baseline_offset` ("NONE" | "SUPERSCRIPT" | "SUBSCRIPT", optional) — Vertical offset. SUPERSCRIPT and SUBSCRIPT render in a smaller font automatically without changing font size. Omit to leave unchanged.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Updates the paragraph style (named style such as HEADING_1, alignment, line spacing, space above/below, indents, direction, keep-with-next, keep-lines-together, page break before, shading) of every paragraph the UTF-16 index range overlaps, and returns the batch update reply. Only the style params you set are changed; the named style is applied before the other properties. The range may extend to adjacent newlines. Borders and other paragraph style fields are reachable through batch_update_document. NOTE: this overwrites the set style properties on those paragraphs. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `start_index` (integer, required) — Zero-based start index of the range, in UTF-16 code units, relative to the segment (from get_document_text or get_document).
- `end_index` (integer, required) — Zero-based end index of the range, exclusive, in UTF-16 code units.
- `tab_id` (string, optional) — ID of the tab that contains the range. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the range. Omit for the document body.
- `named_style_type` ("NORMAL_TEXT" | "TITLE" | "SUBTITLE" | "HEADING_1" | "HEADING_2" | "HEADING_3" | "HEADING_4" | "HEADING_5" | "HEADING_6", optional) — Named style (title, subtitle, heading level or normal text); applied before the other properties because it affects them. Omit to leave unchanged.
- `alignment` ("START" | "CENTER" | "END" | "JUSTIFIED", optional) — Text alignment. Omit to leave unchanged.
- `line_spacing` (number, optional) — Line spacing as a percentage of normal, where normal is 100.0. Omit to leave unchanged.
- `space_above_pt` (number, optional) — Extra space above the paragraph, in points. Omit to leave unchanged.
- `space_below_pt` (number, optional) — Extra space below the paragraph, in points. Omit to leave unchanged.
- `indent_start_pt` (number, optional) — Indent on the side where text starts (per paragraph direction), in points. Omit to leave unchanged.
- `indent_end_pt` (number, optional) — Indent on the side where text ends (per paragraph direction), in points. Omit to leave unchanged.
- `indent_first_line_pt` (number, optional) — Indent of the first line, in points. Omit to leave unchanged.
- `direction` ("LEFT_TO_RIGHT" | "RIGHT_TO_LEFT", optional) — Text direction. Omit to leave unchanged.
- `keep_with_next` (boolean, optional) — Keep at least part of the paragraph on the same page or column as the next one. Omit to leave unchanged.
- `keep_lines_together` (boolean, optional) — Keep all lines of the paragraph on the same page or column. Omit to leave unchanged.
- `page_break_before` (boolean, optional) — Start the paragraph at the top of a page. Setting it in a table, header, footer or footnote can fail with 400. Omit to leave unchanged.
- `shading_color` (string, optional) — Paragraph shading (background) color. Hex color `#RRGGBB`, converted to RGB values from 0.0 to 1.0. Omit to leave unchanged.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Turns every paragraph the UTF-16 index range overlaps into a bulleted or numbered list item using a bullet preset, and returns the batch update reply. Each paragraph's nesting level comes from its leading tab characters, which are removed (shifting later indexes). Paragraphs are joined to a matching list immediately before them. NOTE: this overwrites the list formatting of those paragraphs. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `start_index` (integer, required) — Zero-based start index of the range, in UTF-16 code units, relative to the segment (from get_document_text or get_document).
- `end_index` (integer, required) — Zero-based end index of the range, exclusive, in UTF-16 code units.
- `bullet_preset` ("BULLET_DISC_CIRCLE_SQUARE" | "BULLET_DIAMONDX_ARROW3D_SQUARE" | "BULLET_CHECKBOX" | "BULLET_ARROW_DIAMOND_DISC" | "BULLET_STAR_CIRCLE_SQUARE" | "BULLET_ARROW3D_CIRCLE_SQUARE" | "BULLET_LEFTTRIANGLE_DIAMOND_DISC" | "BULLET_DIAMONDX_HOLLOWDIAMOND_SQUARE" | "BULLET_DIAMOND_CIRCLE_SQUARE" | "NUMBERED_DECIMAL_ALPHA_ROMAN" | "NUMBERED_DECIMAL_ALPHA_ROMAN_PARENS" | "NUMBERED_DECIMAL_NESTED" | "NUMBERED_UPPERALPHA_ALPHA_ROMAN" | "NUMBERED_UPPERROMAN_UPPERALPHA_DECIMAL" | "NUMBERED_ZERODECIMAL_ALPHA_ROMAN", required) — Bullet glyph preset. BULLET_* presets make bulleted lists (BULLET_CHECKBOX makes a checklist); NUMBERED_* presets make numbered lists.
- `tab_id` (string, optional) — ID of the tab that contains the range. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the range. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Inserts a page break followed by a newline at a UTF-16 index, or at the end of the body with at_end, and returns the batch update reply. Page breaks go only in the document body, inside an existing paragraph: not at a table's start index, and not inside a table, equation, footnote, header or footer. NOTE: this changes the document's content at that position. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `index` (integer, optional) — Zero-based insertion index, in UTF-16 code units, relative to the segment (from get_document_text or get_document). Set exactly one of `index` / `at_end`.
- `at_end` (boolean, optional, default: false) — Insert at the end of the document body instead of at `index`. Set exactly one of `index` / `at_end`.
- `tab_id` (string, optional) — ID of the tab the location is in. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Removes the bullets or numbering from every paragraph the UTF-16 index range overlaps, keeping each paragraph's nesting level as indentation, and returns the batch update reply. The text itself is kept. NOTE: this overwrites the list formatting of those paragraphs. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `start_index` (integer, required) — Zero-based start index of the range, in UTF-16 code units, relative to the segment (from get_document_text or get_document).
- `end_index` (integer, required) — Zero-based end index of the range, exclusive, in UTF-16 code units.
- `tab_id` (string, optional) — ID of the tab that contains the range. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the range. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Inserts an empty table with the given rows and columns at a UTF-16 index, or at the end of the body, a header or footer with at_end, and returns the batch update reply. A newline is inserted before the table, so the new table starts at index + 1. The table must go inside an existing paragraph (not at another table's start index) and cannot go inside a footnote or equation. NOTE: this changes the document's content at that position. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `rows` (integer, required) — Number of rows in the table.
- `columns` (integer, required) — Number of columns in the table.
- `index` (integer, optional) — Zero-based insertion index, in UTF-16 code units, relative to the segment (from get_document_text or get_document). Set exactly one of `index` / `at_end`.
- `at_end` (boolean, optional, default: false) — Insert at the end of the body, header or footer instead of at `index`. Set exactly one of `index` / `at_end`.
- `tab_id` (string, optional) — ID of the tab the location is in. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote the location is in. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Inserts an empty row above or below the row of a reference cell (above or below the whole merged cell if it is merged) in the table starting at table_start_index, and returns the batch update reply. NOTE: this changes the table's structure and shifts later indexes. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `table_start_index` (integer, required) — Start index of the table (`tables[].startIndex` from get_document_text, or from get_document).
- `row_index` (integer, required) — Row of the reference cell. Zero-based row index; the second row is 1.
- `column_index` (integer, optional, default: 0) — Column of the reference cell. Zero-based column index; the second column is 1. Defaults to 0.
- `tab_id` (string, optional) — ID of the tab that contains the table. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the table. Omit for the document body.
- `insert_below` (boolean, optional, default: false) — True inserts below the reference cell's row; false inserts above. Defaults to false.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}DESTRUCTIVE — REQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. Permanently deletes the row a reference cell spans, with all its content, from the table starting at table_start_index, and returns the batch update reply. If the cell is merged across several rows, all of those rows are deleted; if no rows remain, the whole table is deleted. The deleted content is not returned and cannot be restored through this server, only by hand from the document's version history. NEVER call this tool autonomously or as part of an automated flow. You MUST stop, tell the user exactly which table row and its content will be deleted and that it cannot be undone through this server, and wait for their explicit written confirmation before proceeding.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `table_start_index` (integer, required) — Start index of the table (`tables[].startIndex` from get_document_text, or from get_document).
- `row_index` (integer, required) — Row of the reference cell; the row it spans is deleted. Zero-based row index; the second row is 1.
- `column_index` (integer, optional, default: 0) — Column of the reference cell. Zero-based column index; the second column is 1. Defaults to 0.
- `tab_id` (string, optional) — ID of the tab that contains the table. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the table. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Inserts an empty column to the left or right of the column of a reference cell (of the whole merged cell if it is merged) in the table starting at table_start_index, and returns the batch update reply. NOTE: this changes the table's structure and shifts later indexes. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `table_start_index` (integer, required) — Start index of the table (`tables[].startIndex` from get_document_text, or from get_document).
- `column_index` (integer, required) — Column of the reference cell. Zero-based column index; the second column is 1.
- `row_index` (integer, optional, default: 0) — Row of the reference cell. Zero-based row index; the second row is 1. Defaults to 0.
- `tab_id` (string, optional) — ID of the tab that contains the table. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the table. Omit for the document body.
- `insert_right` (boolean, optional, default: false) — True inserts to the right of the reference cell's column; false inserts to the left. Defaults to false.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}DESTRUCTIVE — REQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. Permanently deletes the column a reference cell spans, with all its content, from the table starting at table_start_index, and returns the batch update reply. If the cell is merged across several columns, all of those columns are deleted; if no columns remain, the whole table is deleted. The deleted content is not returned and cannot be restored through this server, only by hand from the document's version history. NEVER call this tool autonomously or as part of an automated flow. You MUST stop, tell the user exactly which table column and its content will be deleted and that it cannot be undone through this server, and wait for their explicit written confirmation before proceeding.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `table_start_index` (integer, required) — Start index of the table (`tables[].startIndex` from get_document_text, or from get_document).
- `column_index` (integer, required) — Column of the reference cell; the column it spans is deleted. Zero-based column index; the second column is 1.
- `row_index` (integer, optional, default: 0) — Row of the reference cell. Zero-based row index; the second row is 1. Defaults to 0.
- `tab_id` (string, optional) — ID of the tab that contains the table. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the table. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Merges a range of cells (starting cell plus row and column span) in the table starting at table_start_index into one cell, and returns the batch update reply. Text from the merged cells is concatenated into the head cell (upper-left for left-to-right content, upper-right otherwise). A non-rectangular range, which can happen with already-merged cells or non-rectangular tables, fails with 400. NOTE: this overwrites the cell layout of that range. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `table_start_index` (integer, required) — Start index of the table (`tables[].startIndex` from get_document_text, or from get_document).
- `row_index` (integer, required) — Row of the range's starting cell. Zero-based row index; the second row is 1.
- `column_index` (integer, required) — Column of the range's starting cell. Zero-based column index; the second column is 1.
- `row_span` (integer, required) — Number of rows the range covers.
- `column_span` (integer, required) — Number of columns the range covers.
- `tab_id` (string, optional) — ID of the tab that contains the table. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the table. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Updates the style (background color, content alignment, padding, border color, width and dash style) of a range of table cells, or of every cell when row_span and column_span are both omitted, and returns the batch update reply. Only the style params you set are changed; padding and border settings apply to all four sides. A border shared with an adjacent cell is updated on that cell too. NOTE: this overwrites the set style properties on those cells. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `table_start_index` (integer, required) — Start index of the table (`tables[].startIndex` from get_document_text, or from get_document).
- `row_index` (integer, optional, default: 0) — Row of the range's starting cell. Zero-based row index; the second row is 1. Defaults to 0. Ignored when both spans are omitted.
- `column_index` (integer, optional, default: 0) — Column of the range's starting cell. Zero-based column index; the second column is 1. Defaults to 0. Ignored when both spans are omitted.
- `row_span` (integer, optional) — Number of rows the range covers. Set together with column_span; omit both to style the whole table.
- `column_span` (integer, optional) — Number of columns the range covers. Set together with row_span; omit both to style the whole table.
- `tab_id` (string, optional) — ID of the tab that contains the table. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the table. Omit for the document body.
- `background_color` (string, optional) — Cell background color. Hex color `#RRGGBB`, converted to RGB values from 0.0 to 1.0. Omit to leave unchanged.
- `content_alignment` ("TOP" | "MIDDLE" | "BOTTOM", optional) — Vertical alignment of the cell content. Omit to leave unchanged.
- `padding_pt` (number, optional) — Cell padding in points, applied to all four sides. Omit to leave unchanged.
- `border_color` (string, optional) — Border color, applied to all four borders; cannot be transparent. Hex color `#RRGGBB`, converted to RGB values from 0.0 to 1.0. Omit to leave unchanged.
- `border_width_pt` (number, optional) — Border width in points, applied to all four borders; 0 hides the border. Omit to leave unchanged.
- `border_dash_style` ("SOLID" | "DOT" | "DASH", optional) — Border dash style, applied to all four borders. Omit to leave unchanged.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
}Inserts an image from a public URL as an inline object at a UTF-16 index, or at the end of the body, a header or footer with at_end, and returns the new objectId with the batch update reply. The image is fetched once and a copy is stored in the document. It must be PNG, JPEG or GIF, under 50 MB and at most 25 megapixels, and the URL must be publicly accessible and at most 2 KB long. The image must go inside an existing paragraph and cannot go inside a footnote or equation. NOTE: this changes the document's content at that position. The prior state is not in the response but stays recoverable from the document's version history. Pass required_revision_id (from get_document or get_document_text) to make the edit fail instead of landing on changed content.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `uri` (string, required) — Publicly accessible image URL, at most 2 KB. PNG, JPEG or GIF, under 50 MB, at most 25 megapixels. The URL is saved with the image.
- `width_pt` (number, optional) — Display width in points. With only one dimension set the other keeps the aspect ratio; with both, the image is scaled to fit inside them keeping its aspect ratio. Omit both for a size based on the image's resolution.
- `height_pt` (number, optional) — Display height in points. Same sizing rules as width_pt. Omit both for a size based on the image's resolution.
- `index` (integer, optional) — Zero-based insertion index, in UTF-16 code units, relative to the segment (from get_document_text or get_document). Set exactly one of `index` / `at_end`.
- `at_end` (boolean, optional, default: false) — Insert at the end of the body, header or footer instead of at `index`. Set exactly one of `index` / `at_end`.
- `tab_id` (string, optional) — ID of the tab the location is in. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote the location is in. Omit for the document body.
- `write_mode` ("EDIT" | "SUGGEST", optional, default: "EDIT") — EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID in `suggestionResponses[].createdSuggestionIds`. Defaults to EDIT.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
objectId: string | null;
}Creates an empty default header and applies it to the section that begins at the given section break, or to the whole document style when no section break (or the first one) is given, and returns the new headerId. Fails with 400 if that section or document already has a default header. Write into it with insert_text using segment_id = headerId and at_end = true.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `section_break_index` (integer, optional) — Index of the section break that begins the section the header belongs to. Omit, or give the first section break, to apply it to the document style.
- `tab_id` (string, optional) — ID of the tab that contains the section break. Needs section_break_index (pass 0 to target that tab's document style). Omit to use the first tab.Output data schema:
{
documentId: string;
headerId: string | null;
replies: Record<string, any>[];
}Creates an empty default footer and applies it to the section after the given section break, or to the whole document style when no section break (or the first one) is given, and returns the new footerId. Fails with 400 if that section or document already has a default footer. Write into it with insert_text using segment_id = footerId and at_end = true.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `section_break_index` (integer, optional) — Index of the section break immediately before the section the footer belongs to. Omit, or give the first section break, to apply it to the document style.
- `tab_id` (string, optional) — ID of the tab that contains the section break. Needs section_break_index (pass 0 to target that tab's document style). Omit to use the first tab.Output data schema:
{
documentId: string;
footerId: string | null;
replies: Record<string, any>[];
}Adds a new empty tab to a document, at the given position among its siblings (later tabs shift up by one) and optionally nested under a parent tab, and returns the new tab's properties (tabId, title, index, parentTabId, nestingLevel). All properties are optional. Tab changes are applied as normal edits; they cannot be made as suggestions.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `title` (string, optional) — User-visible name of the tab. Omit for the default name.
- `index` (integer, optional) — Zero-based position of the tab within its parent. Omit for the default position.
- `parent_tab_id` (string, optional) — ID of the parent tab to nest the new tab under. Omit for a root-level tab.
- `icon_emoji` (string, optional) — Emoji icon shown with the tab: exactly one emoji, otherwise the call fails with 400. Omit for the default tab icon.Output data schema:
{
documentId: string;
tabProperties: {
tabId: string | null;
title: string | null;
index: number | null;
parentTabId: string | null;
nestingLevel: number | null;
} | null;
replies: Record<string, any>[];
}DESTRUCTIVE — REQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. Permanently deletes a tab from a document together with all of its child tabs and everything they contain, and returns the batch update reply. The deleted tabs are not returned and cannot be restored through this server, only by hand from the document's version history. NEVER call this tool autonomously or as part of an automated flow. You MUST stop, tell the user exactly which tab and which child tabs will be deleted with their content and that it cannot be undone through this server, and wait for their explicit written confirmation before proceeding.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `tab_id` (string, required) — ID of the tab to delete (from get_document_text or get_document).Output data schema:
{
documentId: string;
replies: Record<string, any>[];
}Updates a document tab's title, position among its siblings, parent tab or emoji icon, and returns the batch update reply. Only the properties you set are changed; others keep their current value. Tab changes are applied as normal edits; they cannot be made as suggestions. NOTE: this overwrites the set tab properties. The prior state is not in the response but stays recoverable from the document's version history.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `tab_id` (string, required) — ID of the tab to update (from get_document_text or get_document).
- `title` (string, optional) — New user-visible name of the tab. Omit to leave unchanged.
- `index` (integer, optional) — New zero-based position of the tab within its parent. Omit to leave unchanged.
- `parent_tab_id` (string, optional) — ID of the new parent tab to nest this tab under. Omit to leave unchanged.
- `icon_emoji` (string, optional) — Emoji icon shown with the tab: exactly one emoji, otherwise the call fails with 400. Omit to leave unchanged.Output data schema:
{
documentId: string;
replies: Record<string, any>[];
}Adds a new comment thread anchored to a UTF-16 index range of a document, optionally assigned to a user by email, and returns the created thread (commentId, anchorId, headPost.postId, status, plainTextQuote) with the batch update reply. Content is plain text, non-empty and at most 2048 UTF-8 bytes, and behaves like a comment made in the Docs editor (formatting, notifications). Check commentUpdateState: ALL_FAILED_UNKNOWN_REASON means the comment change was not saved.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `content` (string, required) — Comment text, as plain text. Non-empty, at most 2048 UTF-8 bytes.
- `start_index` (integer, required) — Zero-based start index of the range, in UTF-16 code units, relative to the segment (from get_document_text or get_document).
- `end_index` (integer, required) — Zero-based end index of the range, exclusive, in UTF-16 code units.
- `tab_id` (string, optional) — ID of the tab that contains the range. Omit to use the first tab; in a single-tab document a provided ID must match that tab.
- `segment_id` (string, optional) — ID of the header, footer or footnote that contains the range. Omit for the document body.
- `assignee_email` (string, optional) — Email address to assign the comment to, at most 2048 UTF-8 bytes. Omit for an unassigned comment.
- `required_revision_id` (string, optional) — Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.Output data schema:
{
documentId: string;
writeControl: {
requiredRevisionId: string | null;
targetRevisionId: string | null;
} | null;
commentThread: {
commentId: string | null;
anchorId: string | null;
headPost: {
postId: string | null;
} | null;
status: string | null;
plainTextQuote: string | null;
} | null;
replies: Record<string, any>[];
commentUpdateState: string | null;
}Adds a reply post to an existing comment thread or suggestion thread, and returns the created post (postId, content, commentAction, author, createTime) with the batch update reply. On a comment thread the reply can also resolve or reopen it (comment_action, no content needed) or reassign it (assignee_email, only when the thread's head post already has an assignee). Content is plain text, at most 2048 UTF-8 bytes, and behaves like a reply made in the Docs editor. Check commentUpdateState: ALL_FAILED_UNKNOWN_REASON means the comment change was not saved.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `comment_id` (string, optional) — ID of the comment thread to reply to (from insert_comment or get_document comments). Set exactly one of `comment_id` / `suggestion_id`.
- `suggestion_id` (string, optional) — ID of the suggestion thread to reply to. Set exactly one of `comment_id` / `suggestion_id`.
- `content` (string, optional) — Reply text, as plain text, at most 2048 UTF-8 bytes. Must be non-empty unless comment_action is RESOLVE or REOPEN.
- `comment_action` ("RESOLVE" | "REOPEN", optional) — Resolve or reopen the comment thread with this post. Comment threads only. Omit for a plain reply.
- `assignee_email` (string, optional) — Email of the user to newly assign the thread to, at most 2048 UTF-8 bytes. Only for a comment thread whose head post already has an assignee, and not together with comment_action. Omit to keep the current assignee.Output data schema:
{
documentId: string;
post: {
postId: string | null;
content: string | null;
commentAction: string | null;
author: Record<string, any> | null;
createTime: string | null;
} | null;
replies: Record<string, any>[];
commentUpdateState: string | null;
}Replaces the text of one post (head post or reply) in a comment thread or suggestion thread, and returns the batch update reply. Fails with 400 if the requesting user is not the post's author or the post is the head post of a suggestion thread. Content is plain text, non-empty, at most 2048 UTF-8 bytes. Check commentUpdateState: ALL_FAILED_UNKNOWN_REASON means the comment change was not saved. NOTE: this overwrites the post's current text. The prior state is not in the response but stays recoverable from the document's version history.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `post_id` (string, required) — ID of the post to update (headPost.postId or a reply's postId).
- `content` (string, required) — New post text, as plain text. Non-empty, at most 2048 UTF-8 bytes.
- `comment_id` (string, optional) — ID of the comment thread the post belongs to. Set exactly one of `comment_id` / `suggestion_id`.
- `suggestion_id` (string, optional) — ID of the suggestion thread the post belongs to. Set exactly one of `comment_id` / `suggestion_id`.Output data schema:
{
documentId: string;
replies: Record<string, any>[];
commentUpdateState: string | null;
}DESTRUCTIVE — REQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. Permanently deletes a comment thread, including its head post and every reply, and returns the batch update reply. Only the author of the thread's head post can delete it; anyone else gets 400. To close a thread without deleting it, use add_comment_reply with comment_action RESOLVE. The deleted thread is not returned and cannot be restored through this server. Check commentUpdateState: ALL_FAILED_UNKNOWN_REASON means the comment change was not saved. NEVER call this tool autonomously or as part of an automated flow. You MUST stop, tell the user exactly which comment thread and how many replies will be deleted and that it cannot be undone through this server, and wait for their explicit written confirmation before proceeding.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `comment_id` (string, required) — ID of the comment thread to delete.Output data schema:
{
documentId: string;
replies: Record<string, any>[];
commentUpdateState: string | null;
}Accepts a suggestion, applying the suggested change to the document, and returns the batch update reply with the accepted IDs in suggestionResponses[].acceptedSuggestionIds. Fails with 403 if the requesting user does not have edit access to the document. Check commentUpdateState: the change can commit while the suggestion thread fails to save. NOTE: this overwrites the suggested range with the suggested change. The prior state is not in the response but stays recoverable from the document's version history.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `suggestion_id` (string, required) — ID of the suggestion, from `suggestedInsertionIds` / `suggestedDeletionIds` in get_document with suggestions_view_mode SUGGESTIONS_INLINE, or from `createdSuggestionIds` of an edit made with write_mode SUGGEST.Output data schema:
{
documentId: string;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
commentUpdateState: string | null;
}Rejects a suggestion, discarding the suggested change, and returns the batch update reply with the rejected IDs in suggestionResponses[].rejectedSuggestionIds. Fails with 403 if the requesting user has no edit access to the document and is not the suggestion's author. Check commentUpdateState: the change can commit while the suggestion thread fails to save. NOTE: this discards the suggested change. The prior state is not in the response but stays recoverable from the document's version history.
Inputs:
- `document_id` (string, required) — The ID of the document to update. Same as the Drive file ID.
- `suggestion_id` (string, required) — ID of the suggestion, from `suggestedInsertionIds` / `suggestedDeletionIds` in get_document with suggestions_view_mode SUGGESTIONS_INLINE, or from `createdSuggestionIds` of an edit made with write_mode SUGGEST.Output data schema:
{
documentId: string;
replies: Record<string, any>[];
suggestionResponses: {
createdSuggestionIds: string[] | null;
acceptedSuggestionIds: string[] | null;
rejectedSuggestionIds: string[] | null;
deletedSuggestionIds: string[] | null;
updatedSummarySuggestionIds: string[] | null;
}[] | null;
commentUpdateState: string | null;
}API Parameters Reference
Every tool returns the same top-level envelope. Only data varies per tool.
// Success
{
"success": true,
"statusCode": 200,
"retriable": false,
"retry_after_seconds": null,
"error": null,
"data": { ... }
}
// Error
{
"success": false,
"statusCode": 400,
"retriable": false,
"retry_after_seconds": null,
"error": { "code": "VALIDATION_ERROR", "message": "Set exactly one of `index` or `at_end`", "details": null },
"data": null
}retriable—truewhen it is safe to retry (rate limit, network error, 503).falsefor validation and auth errors.retry_after_seconds— seconds to wait before retrying; present only whenretriableistrueand the upstream specifies a delay.error.code— machine-readable string:VALIDATION_ERROR,AUTH_ERROR,UPSTREAM_ERROR,SERVER_ERROR.
document_id— The ID of the document to update. Same as the Drive file ID.start_index— Zero-based start index of the range, in UTF-16 code units, relative to the segment (from get_document_text or get_document).end_index— Zero-based end index of the range, exclusive, in UTF-16 code units.index— Zero-based insertion index, in UTF-16 code units, relative to the segment (from get_document_text or get_document). Set exactly one ofindex/at_end.tab_id— ID of the tab that contains the range. Omit to use the first tab; in a single-tab document a provided ID must match that tab.segment_id— ID of the header, footer or footnote that contains the range. Omit for the document body.write_mode— EDIT applies the change as a normal edit; SUGGEST applies it as a suggestion and returns its ID insuggestionResponses[].createdSuggestionIds. Defaults to EDIT.required_revision_id— Revision ID (from get_document or get_document_text) the document must still be at; if it changed since, the edit fails with 400 instead of landing on changed content. Omit to skip the check.table_start_index— Start index of the table (tables[].startIndexfrom get_document_text, or from get_document).
Document ID:
The Drive file ID of the document. The Docs API has no list or search, so find IDs with Drive tools.
Example: 1AbC...Tab ID:
tabs[].tabId from get_document_text, or tabs[].tabProperties.tabId from get_document
Example: t.0Index:
Zero-based UTF-16 code units, relative to the segment (body, header, footer or footnote); end indexes are exclusive
Example: start_index 1, end_index 14 covers "Project Plan\n" in a document that starts with that titleHeader / footer ID (segment_id):
tabs[].headers[].headerId / tabs[].footers[].footerId from get_document_text, or headerId / footerId from create_header / create_footerColor:
#RRGGBB hex, converted to RGB values from 0.0 to 1.0
Example: #1A73E8Revision ID:
Opaque string from revisionId (get_document, get_document_text) or writeControl.requiredRevisionId (edit tools)Troubleshooting
Cause: API key not provided in request headers or incorrect format
Solution:
Verify
Authorization: Bearer YOUR_API_KEYandX-Mewcp-Credential-Id: CREDENTIAL-IDheaders are presentCheck API key is active in your MewCP account
Cause: API calls have exceeded your request limits
Solution:
Check credit usage in your Curious Layer dashboard
Upgrade to a paid plan or add credits for higher limits
Contact support for credit adjustments
Cause: No Google Docs credential linked to your account
Solution:
Go to Credentials in your MewCP dashboard
Connect your Google account (OAuth)
Retry the request with the correct
X-Mewcp-Credential-Idheader
Cause: JSON payload is invalid or missing required fields
Solution:
Validate JSON syntax before sending
Ensure all required tool parameters are included
Check parameter types match expected values
Cause: Incorrect server name in the API endpoint
Solution:
Verify endpoint format:
mewcp-google-docs/mcp/{tool-name}Use correct server name from documentation
Check available servers in your Curious Layer account
Cause: Upstream Google Docs API returned an error
Solution:
Check Google Docs service status at Google Workspace Status Dashboard
Verify your credential has the required permissions
Review the error message for specific details
Google Docs API Documentation — Official API reference
Google Docs API Reference — Complete endpoint reference
FastMCP Docs — FastMCP specification
FastMCP Credentials — FastMCP Credentials package for credential handling
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
Create and manage documents, spreadsheets, and presentations from your AI assistant.
Read, edit and improve shared documents and knowledge with people and agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables comprehensive interaction with Google Docs and Google Drive through AI assistants, supporting document reading/writing, rich formatting, table/image insertion, comment management, and complete file/folder operations with secure OAuth authentication.MIT
- AlicenseNot gradedqualityBmaintenanceEnables reading and editing Google Docs documents, including creating documents, inserting and deleting content, formatting text, and performing find-and-replace operations through natural language.87 npm2MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to create, read, edit, and manage Google Docs and Drive files with support for formatting, comments, tables, images, and bulk operations.571-
- AlicenseAqualityDmaintenanceEnables AI agents to create and edit Google Docs and draft Gmail emails through natural language.7ISC