Chart
chartDraw a chart from a query on a dataset: the query runs like aggregate (or query_rows when it has select), then result columns map onto the chart. x is the group_by column for the axis or categories; y lists metric names (or columns); series splits line, area, columns and bar into one series per value. grain (day, week, month, quarter, year) groups a date column in group_by by that period. mode draws columns and bars stacked, grouped or as 100%. variance, bullet and scorecard take two y columns (actual, then plan or target); candlestick takes four (open, high, low, close). Measures defined as lower is better (costs) are coloured the right way round. Write the title as the takeaway ("Asia Pacific grew fastest in 2026"), not a label, and the subtitle as the measure and unit. Returns the SVG and the chart spec. Charts: line, area, columns, bar, donut, treemap, waffle, funnel, pareto, scatter, heatmap, histogram, kpi, table, variance, bullet, waterfall, scorecard, combo, radar, candlestick, gauge, box, dotPlot.
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": {
"dataset_id": "<dataset_id>",
"chart": "<chart>"
},
"name": "chart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| pie | No | ||
| mode | No | ||
| chart | Yes | ||
| grain | No | Group date and timestamp columns in group_by by this period (week starts Monday); each group is labelled with the period's first day | |
| limit | No | ||
| theme | No | Leave out for the workspace's brand (or datatomcp light when it has none) | |
| title | No | ||
| where | No | ||
| words | No | Replace words the chart draws by itself, e.g. { "plan": "Budget" } | |
| format | No | ||
| invert | No | Lower is better for the values drawn (costs, churn) | |
| select | No | ||
| series | No | ||
| metrics | No | ||
| version | No | The dataset version from an earlier result's meta (or one listed in describe_dataset's versions). Pass it when you chain calls (distinct_values, then aggregate): the answer stays on that version even if the data was refreshed in between (meta then has stale: true and current_version). If that version is no longer kept, the call fails with source_changed. | |
| currency | No | ||
| group_by | No | ||
| order_by | No | ||
| subtitle | No | ||
| highlight | No | ||
| dataset_id | Yes | Dataset id from list_datasets, e.g. ds_ab12cd34ef56 |