Skip to main content
Glama

csv_diff

Compare two CSV or TSV files to report added, removed, and changed rows, per-cell differences, and column changes, with optional key columns for row matching.

Instructions

Row-level diff of two CSV/TSV files: added, removed and changed rows, per-cell changes, columns.

Rows are paired by key_columns (e.g. ["id"] or ["country", "year"]); without key_columns whole rows are compared as an unordered set, so an edited row appears as one removed plus one added row. Reports added/removed columns separately (cells of those columns are not compared) and whether the common columns were reordered. Duplicate keys are paired in file order and reported as a warning. The delimiter (, ; tab |) and BOM/UTF-16 encodings are detected automatically. File a is indexed in memory (limit 2 million rows); file b is streamed.

Args: a, b: file paths. key_columns: column names identifying a row; they must exist in both files. ignore_columns: column names or globs (e.g. "updated_*") whose cells are not compared. delimiter: a single character; auto-detected when omitted. abs_tol, rel_tol: numeric cells (both sides parse as numbers) within tolerance are equal; requires key_columns. max_changes: cap on entries in each of added_rows, removed_rows and changed_rows; summary counts are always complete.

Input Schema

NameRequiredDescriptionDefault
aYes
bYes
abs_tolNo
rel_tolNo
encodingNoauto
delimiterNo
key_columnsNo
max_changesNo
ignore_columnsNo
max_value_charsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so unusually well: it discloses that file a is indexed in memory (2 million row limit) while b is streamed, that duplicate keys are paired in file order and surfaced as a warning, that added/removed column cells are skipped, and that max_changes caps list entries while summary counts stay complete. Encoding/delimiter auto-detection is also stated, which is exactly the kind of operational context annotations would otherwise supply.

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 outcome, then a paragraph of semantics, then a compact Args block — a good structure for a ten-parameter tool. A couple of clauses (BOM/UTF-16 parenthetical, delimiter character list) are incidental but still operational, so waste is minimal.

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?

An output schema exists, so return values are correctly left out, and the description covers everything else an agent needs to call it safely except the encoding and max_value_chars parameters. For a ten-parameter comparison tool with zero annotation and zero schema-description support, that is near complete but not fully closed.

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

Parameters4/5

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

Schema coverage is 0% and the schema titles are bare ('A', 'Abs Tol', 'Max Value Chars'), so the Args block does most of the work: it defines a/b as file paths, explains key_columns constraints, ignore_columns glob syntax with an example, and crucially that abs_tol/rel_tol apply only to numeric cells and require key_columns. Two of ten parameters, encoding and max_value_chars, are never explained anywhere, so an agent must guess what max_value_chars truncates.

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

Purpose5/5

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

Opens with a precise verb+resource+output enumeration: 'Row-level diff of two CSV/TSV files: added, removed and changed rows, per-cell changes, columns.' The CSV/TSV scope plus the row-level framing cleanly separates it from siblings diff_files and diff_text, so an agent can select it without opening any schema.

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

Usage Guidelines4/5

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

Gives strong conditional guidance inside the tool: key_columns pairs rows by identity, without it rows are compared as an unordered set so an edit becomes a remove+add, and tolerances 'requires key_columns'. It never explicitly states when to use this instead of diff_files or diff_text, leaving sibling routing to inference from the names.

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