Driftglass
← All integrations

Google Docs

Documents

Let agents write and edit Google Docs: create documents from Markdown, read any document you share by link, insert and replace text, tables, images, headers and styles.

Actions

17 actions. Call one with POST /v1/tools/{name}/execute or through /mcp.

List documents

readgoogle_docs.list_documentsmcp: google_docs_list_documents

List Google Docs that Driftglass created or opened, newest first. Any other document works by its link.

ArgumentTypeDescription
name_containsstringOnly files whose name contains this text.
page_sizeintegerFiles per page (1-100). Default: 25
page_tokenstringnext_page_token from the previous page.
curl -X POST https://driftglass.io/v1/tools/google_docs.list_documents/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{}}'

Get document

readgoogle_docs.get_documentmcp: google_docs_get_document

Get a document's title and its paragraphs with their start and end indexes (what index-based edits such as insert_text and update_text_style use).

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
max_paragraphsintegerParagraphs to return (1-2000). Default: 300
curl -X POST https://driftglass.io/v1/tools/google_docs.get_document/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>"}}'

Read document as Markdown

readgoogle_docs.get_document_textmcp: google_docs_get_document_text

Read a document's text as Markdown (headings and bullets kept).

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
max_charsintegerTruncate after this many characters. Default: 100000
curl -X POST https://driftglass.io/v1/tools/google_docs.get_document_text/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>"}}'

Find text

readgoogle_docs.find_textmcp: google_docs_find_text

Find every occurrence of a text in a document and return its start and end indexes.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
textrequiredstringText to find.
match_casebooleanCase-sensitive. Default: false
curl -X POST https://driftglass.io/v1/tools/google_docs.find_text/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","text":"<text>"}}'

Create document

writegoogle_docs.create_documentmcp: google_docs_create_document

Create a Google Doc, optionally filled from Markdown (headings, bullet and numbered lists, paragraphs).

ArgumentTypeDescription
titlerequiredstringDocument title.
markdownstringInitial content as Markdown.
curl -X POST https://driftglass.io/v1/tools/google_docs.create_document/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"title":"<title>"}}'

Append Markdown

writegoogle_docs.append_textmcp: google_docs_append_text

Append Markdown (headings, lists, paragraphs) to the end of a document.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
markdownrequiredstringContent to append, as Markdown.
curl -X POST https://driftglass.io/v1/tools/google_docs.append_text/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","markdown":"<markdown>"}}'

Insert text

writegoogle_docs.insert_textmcp: google_docs_insert_text

Insert plain text at an index (from get_document or find_text), or at the end when no index is given.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
textrequiredstringText to insert; use \n for new paragraphs.
indexintegerIndex to insert at (1 is the start).
curl -X POST https://driftglass.io/v1/tools/google_docs.insert_text/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","text":"<text>"}}'

Replace text

writegoogle_docs.replace_textmcp: google_docs_replace_text

Replace every occurrence of a text, e.g. fill {{placeholders}} in a template the user shared.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
findrequiredstringText to find.
replace_withrequiredstringReplacement (may be empty).
match_casebooleanCase-sensitive. Default: true
curl -X POST https://driftglass.io/v1/tools/google_docs.replace_text/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","find":"<find>","replace_with":"<replace_with>"}}'

Delete range

writegoogle_docs.delete_rangemcp: google_docs_delete_range

Delete the content between two indexes.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
start_indexrequiredintegerStart (inclusive).
end_indexrequiredintegerEnd (exclusive).
curl -X POST https://driftglass.io/v1/tools/google_docs.delete_range/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","start_index":1,"end_index":1}}'

Insert table

writegoogle_docs.insert_tablemcp: google_docs_insert_table

Insert an empty table at an index or at the end.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
rowsrequiredintegerRows.
columnsrequiredintegerColumns.
indexintegerIndex to insert at.
curl -X POST https://driftglass.io/v1/tools/google_docs.insert_table/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","rows":1,"columns":1}}'

Insert image

writegoogle_docs.insert_imagemcp: google_docs_insert_image

Insert an image from a public URL (PNG, JPEG or GIF, under 50 MB) at an index or at the end.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
image_urlrequiredstringPublic image URL.
indexintegerIndex to insert at.
width_ptnumberWidth in points.
height_ptnumberHeight in points.
curl -X POST https://driftglass.io/v1/tools/google_docs.insert_image/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","image_url":"<image_url>"}}'

Insert page break

writegoogle_docs.insert_page_breakmcp: google_docs_insert_page_break

Insert a page break at an index or at the end.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
indexintegerIndex to insert at.
curl -X POST https://driftglass.io/v1/tools/google_docs.insert_page_break/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>"}}'

Style text

writegoogle_docs.update_text_stylemcp: google_docs_update_text_style

Make a range bold, italic, underlined, change its size or color, or turn it into a link.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
start_indexrequiredintegerStart (inclusive).
end_indexrequiredintegerEnd (exclusive).
boldbooleanBold.
italicbooleanItalic.
underlinebooleanUnderline.
strikethroughbooleanStrikethrough.
font_sizenumberFont size in points.
colorstringText color as #RRGGBB.
link_urlstringMake the range a link to this URL.
curl -X POST https://driftglass.io/v1/tools/google_docs.update_text_style/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","start_index":1,"end_index":1}}'

Style paragraphs

writegoogle_docs.update_paragraph_stylemcp: google_docs_update_paragraph_style

Turn the paragraphs in a range into a heading, title or normal text, or change their alignment.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
start_indexrequiredintegerStart (inclusive).
end_indexrequiredintegerEnd (exclusive).
stylestring
NORMAL_TEXT | TITLE | SUBTITLE | HEADING_1 | HEADING_2 | HEADING_3 | HEADING_4 | HEADING_5 | HEADING_6
Paragraph style.
alignmentstring
START | CENTER | END | JUSTIFIED
Alignment.
curl -X POST https://driftglass.io/v1/tools/google_docs.update_paragraph_style/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","start_index":1,"end_index":1}}'

Add header

writegoogle_docs.create_headermcp: google_docs_create_header

Add a page header with the given text (fails if the document already has a default header).

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
textrequiredstringHeader text.
curl -X POST https://driftglass.io/v1/tools/google_docs.create_header/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","text":"<text>"}}'

Batch update (advanced)

writegoogle_docs.batch_updatemcp: google_docs_batch_update

Send raw Google Docs API batchUpdate requests, for edits the other actions do not cover. See developers.google.com/docs/api/reference/rest/v1/documents/request.

ArgumentTypeDescription
document_idrequiredstringDocument: The file id, or its full docs.google.com link.
requestsrequiredobject[]Docs API request objects.
curl -X POST https://driftglass.io/v1/tools/google_docs.batch_update/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"document_id":"<document_id>","requests":[]}}'