add_comment
Add an inline comment anchored to a specific text fragment in a Google Doc for feedback or edits. Omit the text fragment to add a general comment on the document.
Instructions
Add an inline comment anchored to a specific text fragment in a Google Doc (the comment is pinned to that exact phrase, like selecting text and commenting on it by hand). USE THIS WHEN the user wants to leave feedback, notes, questions, edits, or review comments on specific passages of a Google Doc — e.g. "review this doc and comment on the weak spots", "leave a comment on that sentence", "add editorial feedback inline". This is the ONLY way to place anchored comments: the Google Docs and Drive APIs cannot anchor a comment to a text range, so this drives a real logged-in Docs session in a browser. Do NOT use for list/reply/resolve/delete — those work over the Drive API. Requires a one-time npx gdocs-comments-mcp login by the human operator (you cannot log in for them). Omit find_text to add a general, unanchored comment on the document instead. Returns only { ok, anchored, occurrence_used, verified } — never document content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | Google Docs document id, or the full docs.google.com/document/d/<id>/edit URL. | |
| find_text | No | Exact single-line text fragment to anchor the comment to. Must match the doc text exactly; pick a fragment unique enough to identify the spot (or pass occurrence). Omit for a general, unanchored comment on the whole document. | |
| occurrence | No | When find_text appears multiple times, anchor to the N-th match (1-based). Default: 1. | |
| comment_text | Yes | The comment body. Plain text; newlines allowed. |