Sumar y agrupar un CSV completo
aggregate_csvGroups and totals remote CSV/TSV/TXT files by chosen columns with exact filters, sums, and ordering, reading the full file so totals cover every row.
Instructions
Group and total a CSV/TSV/TXT at a URL by reading all of it (up to 30 MB, not just its head): group_by columns, sum_columns, exact filters, ordering. Reads decimal commas, pipe or semicolon delimiters and a BOM. Built for files like SRI's sri_ventas_AAAA.csv (sales by province, canton and sector).
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": {
"url": "<url>"
},
"name": "aggregate_csv"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Direct URL to a plain-text CSV/TSV/TXT file (from search_archivos or a CKAN resource). | |
| limit | No | Groups to return (default 50, max 500); the totals always cover all of them. | |
| format | No | text summary (default) or json structured result. | text |
| group_by | No | Comma-separated column names to group by; empty gives one total row. | |
| order_by | No | Result column to sort by, optionally with asc or desc; default is the first total, biggest first. | |
| skip_rows | No | Lines above the header line (default 0). | |
| sum_columns | No | Comma-separated numeric columns to total; empty only counts rows. | |
| filters_json | No | Optional JSON object of exact filters, e.g. '{"PROVINCIA": "PICHINCHA", "MES": [1, 2]}'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filas | No | ||
| source | No | ||
| columnas | No | ||
| metadatos | Yes | ||
| url_fuente | No |