Skip to main content
Glama
cliwant

mcp-sam-gov

cms_query_dataset

Read-only

Query CMS Open Payments datasets by ID, apply server-side filters, and retrieve rows, exact counts, and column schemas.

Instructions

Query a CMS Open Payments DKAN datastore distribution by datasetId + index (keyless; openpaymentsdata.cms.gov). Returns { datasetId, index, results (mode), fields:[{name,type,mysqlType,description}], rows:[…verbatim…] } + honest _meta. ★HONESTY: count is the EXACT grand total → totalAvailable=count + real offset pagination (NOT a page-length lower bound). conditions are server-side self-policing — BAD column → HTTP 400 → invalid_input; filtersDropped is ALWAYS empty (no silent-drop path). limit ≤ 500 is the HARD API cap (higher → invalid_input, no silent clamp). Every column is text, amounts arrive as STRINGS verbatim (null-never-0). ★results:false = COUNT/SCHEMA-discovery mode: no rows, pagination disabled (no livelock), EXACT count + column schema returned. Genuine {count:0} → honest empty; 400/404/HTML/5xx/timeout/missing schema/non-array → THROW. ★SSRF: datasetId (36-char UUID) + index are validated before URL interpolation. ★PII: Open Payments is PUBLIC transparency-BY-LAW data — bounded to targeted vetting (offset ≤ 2000 reach cap), NO enrichment, NO covered_recipient_npi→NPPES auto-join. NOT a conflict-of-interest / fitness / exclusion determination — cross-check SAM + OFAC + OIG-LEIE. The caveat + reach-cap disclosure ride EVERY response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNoDistribution index (default 0 = the primary CSV). Also interpolates into the URL path (int 0..50).
limitNoRows per page, 1..500, default 100. 500 is the HARD DKAN cap (the API 400s over it; this tool rejects >500 loudly).
offsetNo0-based row offset (default 0). ★POLICY reach cap ≤ 2000 (a deliberate targeted-lookup boundary — Open Payments names physicians + amounts); offset > 2000 ⇒ invalid_input.
resultsNoDefault true (return rows). Set false for COUNT/SCHEMA-discovery mode: no rows, pagination disabled, but the EXACT count + every column's schema are returned. (`count` is NOT a toggle — count=true is always on the wire.)
datasetIdYesREQUIRED — the DKAN datasetId, a 36-char LOWERCASE UUID. ★SSRF: it interpolates into the URL PATH, so this strict grammar (no uppercase, no %2F/../, no trailing newline) is the load-bearing path-injection guard. e.g. 'f0d1de67-6852-4093-a036-c9328c256a05' (2025 Research Payment Data).
conditionsNoServer-side filters (≤10, AND-combined) that provably narrow the EXACT count. Each either applies or the call errors — filtersDropped is always empty.
propertiesNoOptional column projection (snake_case column names). Omit for all columns.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.0

TDQS

A4.8/5.0
Behavior5/5

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

In addition to readOnlyHint=true, it discloses error semantics (400/404/HTML/5xx/timeout → THROW), the exact-count vs page-length-lower-bound guarantee, the 500 hard cap, no silent filter drops, SSRF validation of UUID, and the 2000-offset PII reach cap. This far exceeds what annotations alone convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first sentence, with caveats grouped under ★ markers and bolded labels. It is long, but the length is earned: each sentence covers a distinct behavioral guarantee or safety policy needed for correct invocation.

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 supplies the return shape ({datasetId, index, results, fields, rows, _meta}), explains both modes, covers errors, pagination, and policy caps, and disambiguates count semantics. The only minor omission is a detailed _meta field breakdown, which is not essential for calling the tool.

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?

Despite 100% schema coverage, the description enriches every key parameter: datasetId's UUID grammar is framed as the SSRF guard, offset is tied to the PII reach cap, limit to the hard API cap, results to a discovery mode, and conditions to server-side self-policing with bad-column errors. This goes well beyond the schema descriptions.

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?

The first sentence names a specific verb ('Query'), a resource ('CMS Open Payments DKAN datastore distribution'), and the key identifiers ('datasetId + index'), and names the data source (keyless; openpaymentsdata.cms.gov). It clearly distinguishes this from discovery siblings like cms_search_datasets and socrata_query by being a datastore-level query, not a dataset search.

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?

The description asserts when it is appropriate ('targeted vetting') and explicitly what it is NOT ('NO enrichment', 'NOT a conflict-of-interest / fitness / exclusion determination'), directing users to 'cross-check SAM + OFAC + OIG-LEIE'. It does not explicitly name a sibling discovery tool for finding datasetId, so it misses the explicit-alternative bar.

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

Deploy Server

Other Tools