Skip to main content
Glama

run_checks

Read-onlyIdempotent

Gate a JSON document by running count-based checks and returning pass, fail, or inconclusive per expectation. Use it to verify expected match counts before trusting a file.

Instructions

Run deterministic checks — a query plus the count it expects — against a document; one verdict per check: pass, fail, or inconclusive (a | group or | distinct hit its 100,000-value cap, so the count is only a lower bound; never reported as a pass). Pass playbookPath for a jsonloupe playbook file, or checks inline. Playbook functions are JavaScript and are never run here. Expectations: {"type":"no-matches"}, {"type":"at-least-one"}, {"type":"exact-count","count":N}, {"type":"at-most","count":N}, {"type":"at-least","count":N}, {"type":"between","min":M,"max":N}. A check counts matches (groups/distinct values for | group / | distinct); value pipes like | sum are refused. A document that is not valid JSON is refused unless allowRepair is true. Failed and inconclusive checks list their first matched paths. Pass filePath for a one-call answer, or docId to reuse an open document. Use it to gate a document on counts you expect; for an open-ended count or breakdown use run_query.

Input Schema

NameRequiredDescriptionDefault
docIdNoA docId returned by load_doc.
checksNoInline checks; use either this or playbookPath.
filePathNoFile to open and check now instead of supplying docId.
allowRepairNoCheck a document that is not valid JSON after repairing it (default false: refused, as a gate should not pass a broken file).
maxEvidenceNoPaths per failed/inconclusive check (default 3).
playbookPathNoA jsonloupe playbook (.json) whose checks to run.

Output Schema

NameRequiredDescriptionDefault
okYes
hintNo
toolYes
errorNo
evictedNo
structuredTruncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior3/5

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

The annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint=false), and the description adds meaningful context beyond them: the 100,000-value cap that produces an inconclusive verdict, the rule that inconclusive is never reported as a pass, refusal of non-JSON documents unless allowRepair is true, and that playbook functions are JavaScript that is never executed here. It does not, however, describe the output shape or how many verdicts/fields come back for a multi-check run.

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 purpose and verdict semantics, and most sentences carry load-bearing detail. It is dense to the point of being a run-on (semicolon chains, parentheticals), and the invalid-JSON refusal is stated both in the description and in the allowRepair schema description, which is mild duplication.

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?

An output schema exists, so return values need not be spelled out, and the description still covers verdict enumeration and evidence paths for failures. For a six-parameter gating tool with an empty expectation schema, everything an agent needs to construct a valid call is present.

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 coverage is 100%, so baseline would be 3, but the description goes well past the schema: the expectation object is an unconstrained object in the schema, and the description enumerates all six legal forms (no-matches, at-least-one, exact-count, at-most, at-least, between) with their fields. It also explains the docId vs filePath tradeoff, why allowRepair defaults to false, and that value pipes like | sum are refused in queries.

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 and resource: 'Run deterministic checks — a query plus the count it expects — against a document', plus the output shape (one verdict per check: pass, fail, inconclusive). It also names the sibling it is not, contrasting with run_query at the end, so an agent can separate the two gating/reporting tools without opening schemas.

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

Usage Guidelines5/5

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

Explicitly says when to use it ('to gate a document on counts you expect') and names the alternative plus the condition that selects it ('for an open-ended count or breakdown use run_query'). It also routes between input modes: playbookPath vs inline checks, and filePath for a one-call answer vs docId to reuse an open document.

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