Skip to main content
Glama

Sumar y agrupar un CSV completo

aggregate_csv
Read-only

Groups 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

NameRequiredDescriptionDefault
urlYesDirect URL to a plain-text CSV/TSV/TXT file (from search_archivos or a CKAN resource).
limitNoGroups to return (default 50, max 500); the totals always cover all of them.
formatNotext summary (default) or json structured result.text
group_byNoComma-separated column names to group by; empty gives one total row.
order_byNoResult column to sort by, optionally with asc or desc; default is the first total, biggest first.
skip_rowsNoLines above the header line (default 0).
sum_columnsNoComma-separated numeric columns to total; empty only counts rows.
filters_jsonNoOptional JSON object of exact filters, e.g. '{"PROVINCIA": "PICHINCHA", "MES": [1, 2]}'.

Output Schema

NameRequiredDescriptionDefault
filasNo
sourceNo
columnasNo
metadatosYes
url_fuenteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.15.2

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/openWorld/non-destructive, so the safety profile is given. The description adds genuinely useful behavior beyond that: it reads the whole file rather than the head, caps at 30 MB, and tolerates decimal commas, pipe/semicolon delimiters and a BOM. It omits any mention of failure modes (malformed rows, non-numeric columns) or rate limits, which keeps it off a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core operation and packed into a single dense sentence with no filler. The delimiter/BOM clause and the example dataset each earn their place. Slightly heavy punctuation makes it a 4 rather than a crisp 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 8 params, full schema coverage, an output schema and safety annotations, the description fills its remaining obligations: size ceiling, full-read semantics, format tolerances and a usage example. Together with the structured fields that is enough to call it correctly; only explicit sibling routing is absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so params like group_by, sum_columns, filters_json and order_by are already documented at the field level. The description mirrors those names without adding syntax, interaction rules (e.g. how ordering relates to limit) or examples beyond what the schema shows. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('group and total a CSV/TSV/TXT at a URL') with the key scope qualifier that it reads the entire file ('not just its head'), which implicitly separates it from preview-style readers. The example file family (SRI sales by province/canton/sector) makes the intended payload concrete. It stops short of naming a sibling tool explicitly, so sibling differentiation is implied rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Use is implied by the 30 MB full-read scope and the sales-file example, but the description never says when to choose this over downloading the resource or using a preview/head tool. No 'when not to use' or prerequisites are given. An agent can infer the situation, but must do the routing work itself.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools