update_doc
Edit a Google Doc in place destructive
Description
EDIT a Google Doc — the correction append_to_doc cannot make. Two shapes: `replacements:[{find, replace}]` rewrites specific text wherever it appears (call read_doc first and match the text EXACTLY; matchCase:false ignores case), or `rewrite:"…"` replaces the ENTIRE body (rewrite:"" empties it), or `dropdowns:[{title, value}]` sets a dropdown chip (e.g. Status -> Approved — read_doc lists every chip with its options; pass dropdownId when two share a title; an unknown title or option is refused with the real list and nothing changes); the same entry with options:[…] (the COMPLETE new list, 2–50) and/or newTitle changes the dropdown itself for every chip built from it, and an option you drop that a chip shows needs replace:{"Old":"New"}. Find/replace runs immediately and REPORTS how many occurrences changed — zero matches is reported as a FAILURE to match, never as a quiet success, because a text edit that silently does nothing is worse than one that visibly fails. A whole-body rewrite is destructive: call it without confirm first to get the character count, then confirm:true + confirmCells. Both are index-free by design — an agent cannot reliably compute Google’s character offsets, and a wrong offset deletes the wrong sentence.
Parameters
| Parameter | Type | Description |
|---|---|---|
documentId | string | the document id (from create_doc, or list_drive_files for one the user picked) |
docUrl | string | a Google Docs URL — the id is extracted from it |
replacements | object[] | find/replace pairs, applied in order |
replacements[].findrequired | string | exact text to find, as read_doc shows it; zero matches is reported as a failure |
replacements[].replace | string | text to put in place of each match |
replacements[].matchCase | boolean | false ignores letter case when matching; default matches case |
rewrite | string | replace the WHOLE body with this text ("" empties the doc) |
confirm | boolean | true runs a whole-body rewrite after the character count is shown |
confirmCells | number | echo back the character count the unconfirmed call reported (rewrite only) |
dropdowns | object[] | dropdown chips to set, or dropdowns to change |
dropdowns[].title | string | the dropdown title (from read_doc) |
dropdowns[].dropdownId | string | when two dropdowns share a title |
dropdowns[].tabId | string | tab id holding the dropdown, when the document has several tabs |
dropdowns[].value | string | the option to select, by its display text |
dropdowns[].options | string[] | change the dropdown itself: the COMPLETE new option list (2–50) by display text; existing options keep their colour; shared by every chip built from it |
dropdowns[].newTitle | string | rename the dropdown |
dropdowns[].replace | object | for an option you remove that a chip shows: {"Old": "New"} |
Example call
Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and POST https://app.hermoso.ai/v1/tools/update_doc.
MCP (tools/call)
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"update_doc","arguments":{}}}
CLI
hermoso call update_doc --json '{}'
Credits
Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See Credits & costs.
Related tools
append_to_docAppend text to a Google Docread_docRead a Google Docformat_sheetFormat a Google Sheetmanage_sheet_tabsAdd, rename or delete a sheet tabclear_sheet_rangeClear a range in a Google Sheetupdate_sheetWrite to a range in a Google Sheetlist_sheet_tabsList the tabs in a Google Sheet