Create chart (SVG)
create_chartAggregate CSV data and render a bar or line chart as an SVG file in csv-insights-output/, returning the file path and plotted data.
Instructions
Aggregate a CSV and render a bar or line chart as an SVG file in csv-insights-output/. Returns the file path and the plotted data.
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": {
"file": "<file>",
"type": "<type>",
"x": "<x>",
"output_name": "<output_name>"
},
"name": "create_chart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Category / x-axis column | |
| y | No | Numeric column (omit to count rows) | |
| agg | No | sum | |
| top | No | Keep only the first N points after sorting (default 50) | |
| file | Yes | CSV path relative to the allowed directory (CSV_INSIGHTS_DIR), e.g. 'sales/2026-q3.csv' | |
| sort | No | Default: label for line, value_desc for bar | |
| type | Yes | ||
| title | No | ||
| where | No | Row filters, all must match (AND) | |
| output_name | Yes | File name for the chart (written as csv-insights-output/<name>.svg) |