Skip to main content
Glama

validate_data

Check Precis project data against 10 constraint types, including uniqueness, ranges, and foreign keys. Returns row-level errors and a pass/fail summary; read-only, no files modified.

Instructions

Validate Precis project data against all constraint rules (10 types: NotNull, Unique, AllowedValues, Range, ForeignKey, Conditional, Scripted, Charset, DateLogic, Composite). Use it to check data quality or to re-validate data after editing constraint configuration; read-only, it modifies no files. Returns the contract JSON: is_valid (overall pass/fail), errors (one entry per violation, with table name, column name, row number, error_code and details), summary (violation counts); full field definitions in docs/contracts/validate-json-v1.md. Preconditions: manifest points to an existing project.precis.yaml inside the server working directory; a path outside the working directory or a missing file returns an isError result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNoValidate only this table (schema id or table display name); defaults to validating all tables
manifestYesAbsolute path to project.precis.yaml (must be inside the server working directory; paths outside it are rejected)
data_directoryNoRoot directory of the data files. Relative data-source paths declared in the schema resolve against this directory; defaults to the directory containing the manifest

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.11
    • changedInput schema / properties / data_directory / description
      Previous value: -"数据目录(缺省为 manifest 所在目录)"New value: +"Root directory of the data files. Relative data-source paths declared in the schema resolve against this directory; defaults to the directory containing the manifest"
    • changedInput schema / properties / manifest / description
      Previous value: -"project.precis.yaml 路径(须在工作目录内)"New value: +"Absolute path to project.precis.yaml (must be inside the server working directory; paths outside it are rejected)"
    • changedInput schema / properties / table / description
      Previous value: -"只校验指定表(缺省校验全部)"New value: +"Validate only this table (schema id or table display name); defaults to validating all tables"
  2. First observedv0.1.0

TDQS

A4.4/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: it declares read-only behavior ('modifies no files'), spells out the exact return contract (is_valid, errors shape, summary), and names the failure mode (path outside working dir or missing file returns isError). Preconditions are stated up front. This is unusually complete disclosure for an unannotated tool.

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 purpose, then usage, return contract, and preconditions in a logical order; every sentence carries information. It is dense and runs long for a single paragraph, which costs it a point on readability.

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?

No output schema exists, but the description documents the return shape inline and points to docs/contracts/validate-json-v1.md for full field definitions. Preconditions and error behavior are covered, so an agent has everything needed to invoke and interpret the result.

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%, so the schema already documents all three parameters, giving a baseline of 3. The description reinforces the manifest constraint (must point to an existing project.precis.yaml inside the working directory) but adds nothing about the table or data_directory parameters beyond what the schema already says.

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 Precis project data against all constraint rules') and even enumerates the 10 constraint types, which is far more precise than the sibling names check_config, describe_constraints, or infer_schema imply. An agent can tell this is the data-validation tool, not a schema/constraint introspection tool.

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?

Explicitly says when to reach for it: 'check data quality or to re-validate data after editing constraint configuration'. That covers the two main use contexts, but it never contrasts itself against the sibling tools (e.g. describe_constraints) so the routing is inferred rather than stated.

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