Skip to main content
Glama

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

NameRequiredDescriptionDefault
itemNoFor mode "item": the id of the item to replace, e.g. "RF-51". Errors with item_not_found list the ids of the document
modeNo"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
contentYesNew 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**: ...")
sectionNoThe existing heading the mode acts on (required for section, insert_after and rename)
documentIdYesDocument id
reopenApprovedNoOnly 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
expectedRevisionYesThe revision returned by docugen_get_document

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full behavioral burden and does so: it discloses the snapshot/versioning rule (first edit snapshots, later edits in the session create no versions), the sequential-edit contract with the concrete failure mode (parallel edits with the same revision yield revision_conflict), the session lifecycle, and the refusal behavior for approved/implemented documents with its consequence (approval is undone). These are non-obvious traits an agent could not derive from the name or schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and the snapshot/session rule are front-loaded, and the sequencing, mode selection, decision-routing, and approval-warning paragraphs each carry distinct information. It is dense and the mode-selection sentence runs long, but no sentence is filler for a tool of this complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a multi-mode mutation tool with no annotations and no output schema, the definition covers the mutation semantics, the versioning side effect, the concurrency contract and its error code, session termination, and the approved-document refusal path. An agent has everything needed to call it correctly and recover from the two named failure modes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so each parameter (mode, item, section, content, reopenApproved, expectedRevision) is already documented in the schema, which sets the baseline at 3. The description adds a preference heuristic for choosing a mode but otherwise restates constraints the schema already carries, such as always passing the revision from docugen_get_document.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ("Edit a document") and immediately distinguishes itself from siblings by naming docugen_get_document (source of the revision), docugen_answer_decision (for closing decisions), docugen_submit_for_review and docugen_discard_changes (session termination). An agent can tell exactly where this tool sits in the document workflow without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit mode-selection guidance ("prefer mode item ... mode section when changing one part ... use insert_after ... rename"), an explicit exclusion ("To close an open decision, use docugen_answer_decision instead of rewriting it"), and a precondition for the risky path ("ask the user before passing reopenApproved: true"). The when-to-use and when-not-to-use rules are all stated rather than inferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources