docugen_update_document
Edit a document. The first edit snapshots the previous content as a version and opens an edit session; further edits in the same session create no new versions. Always pass the revision you got from docugen_get_document. Send edits one at a time: each edit returns the next revision, to pass on the following edit; two edits sent in parallel with the same revision make the second one fail with revision_conflict. Prefer mode "item" to change one numbered item (RF-51, RN-07, DA-03) without resending its section, and mode "section" when changing one part (headings inside its content become new sections); use "insert_after" to add a new section after one heading and "rename" to change a heading. To close an open decision, use docugen_answer_decision instead of rewriting it: the panel of open decisions only reads its own labels. The session stays open until you call docugen_submit_for_review (or docugen_discard_changes). An approved or implemented document is refused with document_approved: editing it and submitting undoes the approval, so ask the user before passing reopenApproved: true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"documentId": "<documentId>",
"content": "<content>",
"expectedRevision": "<expectedRevision>"
},
"name": "docugen_update_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | No | For mode "item": the id of the item to replace, e.g. "RF-51". Errors with item_not_found list the ids of the document | |
| mode | No | "replace" for the whole document; "section" to replace the body under one heading; "item" to replace one numbered item with its body lines; "insert_after" to add a new section right after one heading and its subsections; "rename" to change the text of one heading | |
| content | Yes | New Markdown content. For insert_after it must start with the new heading (e.g. "## New section"); for rename it is the new heading text only; for item it is the whole item as it should read, keeping its marker and id (e.g. "- **RF-51**: ...") | |
| section | No | The existing heading the mode acts on (required for section, insert_after and rename) | |
| documentId | Yes | Document id | |
| reopenApproved | No | Only after the user agreed: edit an approved or implemented document. Submitting the edit for review moves it back to in_review and the user has to approve it again | |
| expectedRevision | Yes | The revision returned by docugen_get_document |