edit_widget
Edit an existing report widget from a plain-language instruction, validated against the same catalog as add_widget: an impossible change is refused with a reason and nothing changes. Returns a receipt comparing the widget before and after, with the previous configuration for restoring it. widgetId (from get_report) pins the target; otherwise it is identified from the instruction. Granularity words (monthly, weekly, daily) set a chart's time scale. Moves (move, or an instruction naming an existing widget or section) and section operations are supported; a move result carries undo. A text widget is replaced exactly as given with text + widgetId, without AI. A Budget vs actual table takes widgetId + budgetLines. An instruction is read by AI; the preview's aiCost states who pays. Requires MCP write actions; without confirm:true it returns a preview.
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": {
"reportId": "<reportId>"
},
"name": "edit_widget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| move | No | Move the widget given by widgetId, deterministically (no AI; instruction is not needed and is ignored). A section moves with its widgets through an instruction instead. | |
| text | No | TEXT widgets only: the complete new body (HTML or plain text, at most 50,000 characters), replacing the body as given with no AI; unsafe markup is removed. Styling is carried by attributes, never inline styles: <span data-tone="muted|accent|positive|warning|negative"> (text colour), <span data-mark="lime|green|amber|rose"> (highlight), <span data-size="small|large">, <div data-callout="note|tip|warning|important"> (a tinted box around one block) and <hr> (a divider); each is painted with the report theme's own colours in light and dark mode and in the PDF. | |
| confirm | No | Set true to apply. Omit for a preview of what will be interpreted. With confirm:true, also pass the preview's previewToken. | |
| channels | No | With budgetLines: restrict to these channels, e.g. ["Google Ads", "Meta Ads"] (default every connected paid channel). | |
| reportId | Yes | Report id (from list_reports). | |
| widgetId | No | Exact widget id (from get_report) to pin the target. Required with text. | |
| budgetLines | No | Budget vs actual table (All channels), no AI: the product lines in order. A campaign goes to the FIRST line it matches; the rest shows as Not assigned. A month with no budget reads '—', never 0. add_widget builds the table (instruction names it); edit_widget with widgetId replaces the table's COMPLETE list. | |
| instruction | No | The change, in plain language. Can also remove a widget ('remove the donut'). Required unless text is passed. | |
| previewToken | No | With confirm:true: the previewToken from this tool's preview (valid 15 minutes, once, for exactly the previewed arguments). | |
| plannedSource | No | With budgetLines: where the planned budget comes from. settings = the campaigns' own budgets (Google Ads, Meta), read daily, history from the first reading; manual (default) = the amounts given; settings+manual = settings, but a month with an amount given uses it. On edit_widget it can be sent alone. | |
| budgetCurrency | No | With budgetLines: the ISO currency the budgets are in, e.g. EUR. Optional: without it the table labels the accounts' dominant currency on each render and says so. |