# Hermoso: update_doc: Edit a Google Doc · Hermoso developer docs

> Machine-readable twin of https://hermoso.ai/docs/reference/files/update_doc/. Generated from the shipped page. Do not edit by hand.
> Full agent guide: https://hermoso.ai/llms.txt · MCP: https://app.hermoso.ai/mcp

[Docs](https://hermoso.ai/docs/) / [Tool reference](https://hermoso.ai/docs/reference/) / [Files & documents](https://hermoso.ai/docs/reference/files/) / update_doc

# `update_doc`

Edit a Google Doc in place destructive

Area: The Sheets / Docs WRITE surface · [Files & documents](https://hermoso.ai/docs/reference/files/). Generated from the running MCP server, like the rest of the [tool reference](https://hermoso.ai/docs/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

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[].find` required `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](https://hermoso.ai/docs/credits/).

## Related tools

- [append_to_doc](https://hermoso.ai/docs/reference/files/append_to_doc/) Append text to a Google Doc
- [read_doc](https://hermoso.ai/docs/reference/files/read_doc/) Read a Google Doc
- [format_sheet](https://hermoso.ai/docs/reference/files/format_sheet/) Format a Google Sheet
- [manage_sheet_tabs](https://hermoso.ai/docs/reference/files/manage_sheet_tabs/) Add, rename or delete a sheet tab
- [clear_sheet_range](https://hermoso.ai/docs/reference/files/clear_sheet_range/) Clear a range in a Google Sheet
- [update_sheet](https://hermoso.ai/docs/reference/files/update_sheet/) Write to a range in a Google Sheet
- [list_sheet_tabs](https://hermoso.ai/docs/reference/files/list_sheet_tabs/) List the tabs in a Google Sheet

[All 37 Files & documents tools](https://hermoso.ai/docs/reference/files/) · [tools.json](https://hermoso.ai/docs/reference/tools.json)
