docs_add_comment
Attach a comment to a specific phrase in a Google Doc, so feedback is anchored to the exact content it refers to.
Instructions
Add a comment anchored to specific text in a Google Doc.
NOTE: The current implementation uses the Drive comments API plus a Docs named range. In the Docs UI this still shows as "Original content deleted" rather than a proper inline comment highlight. The comments ARE readable via docs_read_comments and the Docs 💬 panel.
The next path to investigate is Apps Script automation. The OAuth token must include the script.* scopes, and the Google account must also have the Apps Script API enabled at https://script.google.com/home/usersettings before remote Apps Script project creation/execution will work.
By default the tool also appends the matched anchor text into the comment body so the user can understand what was targeted even though the Docs UI does not render a proper inline highlight with the current API path.
When bookmark_jump=True, the tool also uses a persistent Apps Script bridge (configured via GOOGLE_DOCS_MCP_APPS_SCRIPT_ID) to create a bookmark at the target text, then appends a #bookmark jump URL into the comment body.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | Google Doc ID (from the URL: /document/d/{DOC_ID}/edit) | |
| comment | Yes | The comment text to post | |
| occurrence | No | Which occurrence of anchor_text to use (default 1 = first). Use 2, 3, etc. if the text appears multiple times. | |
| anchor_text | Yes | Exact text in the document to attach the comment to. Use a short, unique phrase (a few words) for reliable matching. | |
| bookmark_jump | No | If True, create an Apps Script bookmark and append a jump URL into the comment body. Requires the Apps Script bridge env var setup documented in the README. | |
| include_anchor_text | No | If True (default), append the matched anchor text excerpt into the comment body for human readability. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |