build_report
Create a finished Excel report from spreadsheet data in one call: grouped, sorted summary metrics with live totals and chart, plus a filterable data sheet.
Instructions
Create a finished Excel report in one call: a Summary sheet (grouped metrics sorted by the first metric, a live-formula totals row, styled header, number formats, frozen header, chart) plus a filterable Data sheet.
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": {
"source": "<source>",
"output": "<output>",
"group_by": "<group_by>",
"metrics": "<metrics>"
},
"name": "build_report"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Only the top N groups (by the first metric). | |
| sheet | No | Sheet name (or 0-based index). Default: first sheet. | |
| title | No | Report / chart title. | |
| where | No | Optional SQL filter, e.g. "Year = 2024". | |
| output | Yes | Report file to create, e.g. 'sales_report.xlsx'. | |
| source | Yes | Data file; for a specific sheet use 'book.xlsx#Sheet1' or the sheet parameter. | |
| metrics | Yes | e.g. ['Revenue:sum', 'Units:avg', 'count'] (same syntax as aggregate). | |
| group_by | Yes | Summary rows, e.g. ['Region']. | |
| overwrite | No | Replace an existing report (a backup is kept). | |
| chart_type | No | Summary chart. | column |
| include_data | No | Add a 'Data' sheet with the (filtered) rows. | |
| number_format | No | Number format for metrics, e.g. '#,##0.00' or '[$৳-845]#,##0.00' for BDT. | #,##0.00 |