Apply an edit plan
apply_planApply a DocumentPlan JSON to a Word document by connectionId and documentId, then save through the provider in Replace, NewVersion, or NewDocument mode.
Instructions
Apply a DocumentPlan JSON to (connectionId, documentId) and save through the provider. Returns {isValid, committed, writeOutcome, possibleOutput, receipt, sourceDocumentId, outputConnectionId, outputDocumentId, outputVersion, outputName, outputContentType, changes, errors, calculation}; non-applicable values are null. The receipt hashes the effective plan and exact input/output bytes and keeps the host-authenticated actor separate from the plan's display revision author. saveMode: 'Replace' (default, overwrites the source after an optimistic version check), 'NewVersion' (keeps the source and mints a new id under the same connection), 'NewDocument' (mints a fresh id with an optional newName for display). Plan-validation and operation-conflict failures have writeOutcome 'notWritten'. A provider failure after a write began may instead return 'unknown' or 'writtenNotRegistered' with possibleOutput; never retry those blindly or report the document unchanged until the host reconciles the possible output.
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": {
"connectionId": "<connectionId>",
"documentId": "<documentId>",
"planJson": "<planJson>",
"saveMode": "<saveMode>",
"newName": "<newName>"
},
"name": "apply_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newName | Yes | ||
| planJson | Yes | ||
| saveMode | Yes | Replace | |
| documentId | Yes | ||
| connectionId | Yes |