Refresh a document from a workbook
refresh_documentUpdate a Word report or PowerPoint deck from an Excel workbook by refreshing bound markers with current values, tables, and charts; preview changes before saving, and write all or nothing.
Instructions
Update a Word report or PowerPoint deck from an Excel workbook in one call: this month's numbers, tables and charts from this month's workbook. source is the document and workbookSource the workbook, both as edit_document takes source; workbookConnectionId defaults to connectionId. The document says what to update through markers that name a workbook range, written by the bindData operation or by hand: a Word content control or PowerPoint text shape bound to one cell takes its displayed value, number format applied; a bound table is filled from its range, growing or shrinking by rows; a bound chart takes its range with the series names in the first row and the categories in the first column, and keeps its colours and layout. A range is Sheet!B2, 'Sheet name'!A1:D6, a defined name, or an Excel table name. Run with preview=true first: it lists every binding and what it will write, and saves nothing. A refresh is all or nothing - if any binding cannot be read, nothing is written and each problem is listed. saveMode and newName behave as in apply_plan; NewVersion keeps last month's document beside the new one. Returns the edit_document shape plus bindings: [{kind, marker, reference, range, target, summary, errorCode, message}].
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>",
"source": "<source>",
"workbookSource": "<workbookSource>",
"preview": "<preview>",
"saveMode": "<saveMode>",
"newName": "<newName>",
"workbookConnectionId": "<workbookConnectionId>"
},
"name": "refresh_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| newName | Yes | ||
| preview | Yes | ||
| saveMode | Yes | Replace | |
| connectionId | Yes | ||
| workbookSource | Yes | ||
| workbookConnectionId | Yes |