Skip to main content
Glama
devops-gm88

mcp-validation-server

by devops-gm88

validate_rows

Validate tabular rows against a column contract and return accepted rows plus a quarantine list with per-row failure reasons.

Instructions

Validate rows against a column contract and quarantine what fails.

Use this when you have tabular data (spreadsheet rows, CSV records, query results) and you need to know which records are trustworthy before using them. It applies each column's rules — required, type, range, pattern, allowed values — and returns two lists: the rows that passed, and an explicit quarantine list giving a reason for every row that did not.

Nothing is ever silently dropped. accepted plus quarantine always equals the number of rows you passed in, and each quarantined entry carries a locator (row index, row number, and the column that failed) plus a reasons list and machine-readable findings.

Do NOT use this to repair data. It reports; it does not fix, coerce silently, or delete. Coercion only happens where it is unambiguous ("100.50" becomes the number 100.5), and the cleaned value is returned so you can see it.

Args: rows: The data, as an array of objects. Each object is one row, mapping column name to value. Example: [{"invoice": "INV-1", "amount": "100.50", "date": "2026-04-01"}]. columns: The contract, as an array of column specs. Example: [{"name": "invoice", "type": "string", "required": true, "pattern": "INV-\\d+"}, {"name": "amount", "type": "number", "min": 0, "max": 1000000}, {"name": "date", "type": "date", "required": true}]. A required column applies to every row. Unknown spec keys are rejected rather than ignored, so a typo cannot become a rule that quietly never runs. Every column in columns must be listed once. row_key: Optional name of a column to quote in each locator, so that quarantined rows can be matched back to a record by a human. It does not affect validation.

Returns: An object with: ok (true only if no row was quarantined), verdict ("clean" | "flagged" | "quarantined"), summary (rows_in, accepted, quarantined, flagged, pass_rate, accounted_for), accepted (the passing rows, with unambiguous coercions applied), quarantine (each entry: locator, row, reasons, findings), flagged (rows kept despite a problem on a flag-mode column), errors_by_column, findings_by_code, columns_seen, columns_required_but_absent, contract (the parsed contract, so you can confirm which rules ran), findings, and guidance.

`columns_required_but_absent` is worth checking before anything else: a
required column missing from every row usually means the wrong sheet or
the wrong header row was read, which is a different problem from bad data.

Raises: ToolError: if columns is malformed — an unknown type, a bad regular expression, a duplicate column name, an unparseable spec. There is nothing to validate until the contract parses, so the call is rejected with a message naming the offending column and listing the keys and types that are accepted. Row content never raises: a row that is not an object is quarantined with the reason.

    The contract is the call's definition, so a broken contract is an
    argument error. The rows are the data, so broken rows are a result.
    That is the line this server draws.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes
columnsYes
row_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/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 burden and does so thoroughly: it promises nothing is silently dropped, states the invariant accepted + quarantine = rows_in, documents that each quarantine entry carries locator/reasons/findings, bounds coercion to unambiguous cases with the cleaned value surfaced, and draws a precise line between contract errors (ToolError) and bad rows (quarantined). This is exactly the behavioral context an agent needs before calling a mutation-free validator.

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?

It is long, but the length is justified by zero schema description coverage and the Args/Returns/Raises structure is front-loaded with the core purpose first. A few lines (the 'contract is the call's definition' paragraph) restate an idea already conveyed, but nothing is wasted enough to hurt usability.

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?

For a 3-param validator with a malformed-input failure mode, the description covers purpose, usage boundaries, error semantics, and the full Args contract. Return-value detail partly overlaps the existing output schema but adds handling advice ('check columns_required_but_absent before anything else') that the schema alone cannot convey.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does: each of the three params gets a concrete example (row object, column spec with type/min/max/pattern/required), plus non-obvious rules such as unknown spec keys being rejected and every column being listed exactly once. row_key's no-op-on-validation semantics are also stated.

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?

States a specific verb+resource ('Validate rows against a column contract and quarantine what fails') and names the exact artifact returned (two lists: accepted and quarantine). An agent can distinguish this from reconcile, count_distinct, and duplicate_report purely from the first sentence.

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 a clear when-to-use trigger (tabular data / need to know which records are trustworthy) and an explicit when-not ('Do NOT use this to repair data. It reports; it does not fix, coerce silently, or delete.'). It does not name a specific sibling tool to use instead, so it falls just short of the top band.

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