Provenance
Freshness & coverage
Methods (6)
updateParagraph
writeUpdate paragraph formatting or fields within a document range.
Input schema
{ "type": "object", "properties": { "documentId": { "type": "string" }, "range": { "type": "object", "properties": { "startIndex": { "type": "number" }, "endIndex": { "type": "number" }, "segmentId": { "type": "string" } }, "required": [ "startIndex", "endIndex" ], "additionalProperties": false }, "style": { "type": "object", "properties": {}, "additionalProperties": true }, "fields": { "type": "string" } }, "additionalProperties": false, "required": [ "documentId", "range", "style", "fields" ] }createDocument
writeCreate a new Google Docs document.
Required paramstitleInput schema
{ "type": "object", "properties": { "title": { "type": "string", "description": "Document title." } }, "additionalProperties": true, "required": [ "title" ] }getDocument
readFetch the full Google Docs structural payload.
Required paramsdocumentIdInput schema
{ "type": "object", "properties": { "documentId": { "type": "string", "description": "Google Docs document ID." }, "suggestionsViewMode": { "oneOf": [ { "type": "string", "enum": [ "DEFAULT_FOR_CURRENT_ACCESS" ] }, { "type": "string", "enum": [ "SUGGESTIONS_INLINE" ] }, { "type": "string", "enum": [ "PREVIEW_SUGGESTIONS_INLINE" ] } ] } }, "additionalProperties": true, "required": [ "documentId" ] }getDocumentText
readExtract plain text from a Google Docs document.
Required paramsdocumentIdInput schema
{ "type": "object", "properties": { "documentId": { "type": "string", "description": "Google Docs document ID." }, "suggestionsViewMode": { "oneOf": [ { "type": "string", "enum": [ "DEFAULT_FOR_CURRENT_ACCESS" ] }, { "type": "string", "enum": [ "SUGGESTIONS_INLINE" ] }, { "type": "string", "enum": [ "PREVIEW_SUGGESTIONS_INLINE" ] } ] } }, "additionalProperties": true, "required": [ "documentId" ] }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", "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." } }, "additionalProperties": false, "description": "Insertion location. Always pass {index: <number>}.", "required": [ "index" ] }, "endOfSegmentLocation": { "type": "object", "properties": { "segmentId": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": true, "required": [ "documentId", "text", "location" ] }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", "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." } }, "additionalProperties": true, "description": "Character range to format. endIndex is exclusive.", "required": [ "startIndex", "endIndex" ] }, "style": { "type": "object", "properties": {}, "additionalProperties": true, "description": "TextStyle to apply, e.g. {bold: true} or {italic: 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." } }, "additionalProperties": true, "required": [ "documentId", "range", "style", "fields" ] }
