Provenance
Freshness & coverage
Methods (6)
createDocument
writeCreate a new Google Docs document.
Required paramstitleInput schema
{ "type": "object", "properties": { "title": { "type": "string", "description": "Document title." } }, "required": [ "title" ], "additionalProperties": true }getDocument
readFetch the full Google Docs structural payload.
Required paramsdocumentIdInput schema
{ "type": "object", "properties": { "documentId": { "type": "string", "description": "Google Docs document ID." } }, "required": [ "documentId" ], "additionalProperties": true }getDocumentText
readExtract plain text from a Google Docs document.
Required paramsdocumentIdInput schema
{ "type": "object", "properties": { "documentId": { "type": "string", "description": "Google Docs document ID." } }, "required": [ "documentId" ], "additionalProperties": true }insertText
writeInsert text into a Google Docs document at a 1-based character index. To append at the very start of an empty doc use {index: 1}. Body text starts at index 1 because index 0 is the section break.
Required paramsdocumentIdtextlocationInput schema
{ "type": "object", "properties": { "documentId": { "type": "string", "description": "Google Docs document ID." }, "text": { "type": "string", "description": "Text to insert. Use \\n for line breaks." }, "location": { "type": "object", "description": "Insertion location. Always pass {index: <number>}.", "properties": { "index": { "type": "integer", "description": "1-based character index where text is inserted." }, "segmentId": { "type": "string", "description": "Optional segment id for headers/footers; omit for body." } }, "required": [ "index" ], "additionalProperties": false } }, "required": [ "documentId", "text", "location" ], "additionalProperties": true }applyFormatting
unknownApply text style (bold, italic, etc.) to a character range in a Google Doc. Use getDocument first to find paragraph startIndex/endIndex.
Required paramsdocumentIdrangestylefieldsInput schema
{ "type": "object", "properties": { "documentId": { "type": "string", "description": "Google Docs document ID." }, "range": { "type": "object", "description": "Character range to format. endIndex is exclusive.", "properties": { "startIndex": { "type": "integer", "description": "1-based start index (inclusive)." }, "endIndex": { "type": "integer", "description": "End index (exclusive)." }, "segmentId": { "type": "string", "description": "Optional segment id for headers/footers." } }, "required": [ "startIndex", "endIndex" ], "additionalProperties": true }, "style": { "type": "object", "description": "TextStyle to apply, e.g. {bold: true} or {italic: true}.", "additionalProperties": true }, "fields": { "type": "string", "description": "Comma-separated list of style fields being set, e.g. \"bold\" or \"bold,italic\". Required by the Google Docs API." } }, "required": [ "documentId", "range", "style", "fields" ], "additionalProperties": true }updateParagraph
write
