Append to Google Doc
google_docs_append_contentAppend text to an existing Google Doc using only document ID and content. Add updates or notes without calculating Docs insertion indexes.
Instructions
Append plain text to the end of an existing Google Doc.
When to use:
Add content to a known document without calculating Google Docs insertion indexes.
Pass the document ID only (not a full Docs URL).
Required parameters: document_id, content (non-empty). Optional: add_newline_before (default true), add_newline_after (default false).
Side effects: Mutates the document body by inserting text at the end of the body segment. Uses revision WriteControl so concurrent edits are detected rather than applied blindly.
Success: Returns document_id, appended_characters, and provider "google_docs". Common failures: VALIDATION_ERROR (empty content), RESOURCE_NOT_FOUND, AUTHENTICATION_REQUIRED, AUTHORIZATION_DENIED, GOOGLE_API_ERROR (including stale revision).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Required. Non-empty text to append to the document body. | |
| document_id | Yes | Required. Google Docs document ID (not the full URL). | |
| add_newline_after | No | When true, ensure appended content ends with a newline. Defaults to false. | |
| add_newline_before | No | When true, ensure appended content starts on a new line. Defaults to true. |