add_widget
Add a data widget (table, chart, KPI) to a report from a plain-language instruction. The request is mapped to the report's connected data; when the data is not connected or the metric is not supported yet, the answer gives the reason. Blended all-channels widgets need two or more paid ad accounts; their blended rates are recomputed from pooled totals, never averaged. Granularity words (daily, weekly, monthly) set a chart's time scale; a period ("last 12 months") is not one. GA4 visits by channel per month is the GA4 table "Channel × Month": one row per channel, one column per calendar month, one metric. The widget goes at the end of the report unless position (start, end, before or after a widget, section_start or section_end, with anchorId from get_report) or the instruction names an existing widget or section. budgetLines builds a Budget vs actual table without AI. The instruction is read by AI; the preview's aiCost states who pays. Free-text blocks use add_text_widget. 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>",
"instruction": "<instruction>"
},
"name": "add_widget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | With budgetLines only: the table's title. | |
| confirm | No | Set true to add it. Omit for a preview of what will be interpreted and added. With confirm:true, also pass the preview's previewToken. | |
| anchorId | No | With position before, after, section_start or section_end: the id of the widget or section (from get_report). After a section = after everything in it. | |
| channels | No | With budgetLines: restrict to these channels, e.g. ["Google Ads", "Meta Ads"] (default every connected paid channel). | |
| position | No | Where the widget goes (default end, or what the instruction states): start, end, before / after a widget, section_start / section_end of a section. All but start and end need anchorId. Wins over a placement in the instruction. | |
| reportId | Yes | Report id (from list_reports). | |
| 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 | Yes | What widget to add, in plain language. It may say where ("right after the Top campaigns table", "at the end of the SEO section") when it names an existing widget or section. | |
| 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. |