hermosodocs

update_doc

Edit a Google Doc in place destructive

Area: The Sheets / Docs WRITE surface · Files & documents. Generated from the running MCP server, like the rest of the tool reference.

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

ParameterTypeDescription
documentIdstringthe document id (from create_doc, or list_drive_files for one the user picked)
docUrlstringa Google Docs URL — the id is extracted from it
replacementsobject[]find/replace pairs, applied in order
replacements[].findrequiredstringexact text to find, as read_doc shows it; zero matches is reported as a failure
replacements[].replacestringtext to put in place of each match
replacements[].matchCasebooleanfalse ignores letter case when matching; default matches case
rewritestringreplace the WHOLE body with this text ("" empties the doc)
confirmbooleantrue runs a whole-body rewrite after the character count is shown
confirmCellsnumberecho back the character count the unconfirmed call reported (rewrite only)
dropdownsobject[]dropdown chips to set, or dropdowns to change
dropdowns[].titlestringthe dropdown title (from read_doc)
dropdowns[].dropdownIdstringwhen two dropdowns share a title
dropdowns[].tabIdstringtab id holding the dropdown, when the document has several tabs
dropdowns[].valuestringthe option to select, by its display text
dropdowns[].optionsstring[]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[].newTitlestringrename the dropdown
dropdowns[].replaceobjectfor 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.

All 37 Files & documents tools · tools.json