Skip to main content
Glama

Payload Validator

Validate CSV

validate_csv
Read-only

Validates CSV text against RFC 4180 and reports ragged rows individually, with both field counts.

Use this before loading a CSV, and whenever a CSV-derived number looks wrong.

Do not attempt this by reading the file, and be aware that loading it successfully proves nothing. The failure that matters is the ragged row: a file where one row has six fields and the header has five loads without complaint almost everywhere — pandas pads or throws depending on the engine, Excel shifts the columns, and split(",") silently mis-assigns every field after the extra one. Nobody notices until a figure is wrong in a report. This reports it as "row 4813 has 6 fields; the header has 5", per row.

The other half is the delimiter. A European CSV is semicolon-separated because the comma is the decimal separator; reading it as comma-separated yields one column of nonsense and no error. The delimiter is sniffed from the header — ignoring quoted regions so their contents cannot vote — and always reported, with a warning when the guess was a close call. Pass delimiter to remove the guess entirely.

Also reports: unterminated quotes (which swallow the rest of the file into one field, which is why one typo can make thousands of rows look ragged), text after a closing quote, stray quotes in unquoted fields, duplicate column names, unnamed columns, column names with invisible leading or trailing whitespace, mixed CRLF/LF line endings, CR-only endings, and a byte order mark — which becomes part of the first column's name, so a lookup for "id" fails against a column that prints identically.

Input: input, the raw CSV text. Optional delimiter (a single character) and hasHeader (default true; pass false and rows are compared against the first row instead, and header checks are skipped). Up to 1,000,000 bytes.

Returns: valid (no errors), parseable (whether a conforming parser would accept it — deliberately separate, because a duplicate key parses fine and still means two different things), a diagnostics array where each entry has a 1-based line and column, a stable rule code, a message, an excerpt showing the offending line with a caret under the column, a fixHint, and blocksParse; plus counts and format-specific stats. Rule codes are stable and safe to branch on; messages are not.

Safety: nothing is resolved, fetched or expanded. External XML entities are reported, never retrieved; alias bombs are detected without being expanded; no schema or DTD is fetched over the network. Payloads are validated in memory and never stored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesThe raw document text, not a parsed object — the findings are properties of the text. Up to 1,000,000 bytes.
delimiterNoField delimiter, as a single character. Omit to sniff it from the header. Pass it when you know it — a semicolon-separated European export read as comma-separated produces one column and no error.
hasHeaderNoWhether the first row names the columns. Default true. Pass false and rows are compared against the first row instead, and header checks are skipped.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, yet the description adds substantial behavior beyond them: the valid-vs-parseable distinction, stable rule codes vs unstable messages, delimiter-sniffing mechanics, and a full safety disclosure (nothing resolved, fetched or expanded; no network schema/DTD retrieval; never stored). It even explains failure modes like unterminated quotes swallowing the file. No contradiction — readOnlyHint matches the 'validated in memory and never stored' claim.

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?

The description is long but dense, and the core purpose is front-loaded before any context. The pandas/Excel/split narrative earns its place by explaining why a validating tool beats manual parsing, and the closing safety paragraph covers the remaining burden. Slightly more illustrative prose than strictly necessary, but every paragraph serves a function.

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

Completeness5/5

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

With no output schema, the description carries the full burden of explaining return values — and it does in detail (valid, parseable, diagnostics array with line/column/rule/message/excerpt/fixHint/blocksParse, counts, stats). It also covers size limits, all detection categories, parameter behavior, and safety. For a tool with this complexity, nothing an agent needs to call it correctly is missing.

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 coverage is 100% for all three parameters, and the 'Input' section largely restates the schema's descriptions (delimiter single character, hasHeader default true, 1,000,000-byte limit). It adds some rationale (why delimiter sniffing matters, rows compared against the first row when no header) but does not meaningfully extend what the schema already documents, keeping it at the high-coverage baseline.

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+standard: 'Validates CSV text against RFC 4180 and reports ragged rows individually, with both field counts.' The CSV target cleanly distinguishes it from sibling validators validate_json/xml/yaml/auto, and the specific mention of ragged-row reporting describes concrete behavior rather than restating the name.

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 explicit when-to-use triggers ('Use this before loading a CSV, and whenever a CSV-derived number looks wrong') and a clear when-not ('Do not attempt this by reading the file' plus 'loading it successfully proves nothing'). However, it never mentions the validate_auto sibling for format auto-detection, and the named alternatives are manual processes (pandas, Excel, split), so it stops just short of full sibling routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool targets a single unambiguous format (JSON, YAML, XML, CSV), and validate_auto is explicitly differentiated from the format-specific tools with guidance on when to prefer one over the other. The cross-references in the descriptions remove any possible confusion between the auto-detector and the dedicated validators.

Naming Consistency5/5

All five tools follow the exact same validate_<format> pattern with consistent snake_case naming. validate_auto fits the pattern naturally alongside validate_json, validate_yaml, validate_xml, and validate_csv, making the tool set predictable at a glance.

Tool Count5/5

Five tools is well-scoped for a payload validation server: auto-detection plus the four dominant text data formats. Each tool earns its place and there are no redundant or filler tools.

Completeness5/5

The validation surface is complete for the stated domain — the four major serialization formats are covered with deep edge-case handling, and validate_auto fills the gap for unknown formats. Possible additions like TOML or JSON Schema validation are outside the server's apparent scope and would be scope creep rather than natural missing coverage.

Resources