Skip to main content
Glama

Cdc Query Dataset

cdc_query_dataset
Read-only

Execute a SoQL query against any CDC dataset. Supports filtering, aggregation, sorting, full-text search, and field selection. Use cdc_discover_datasets to find dataset IDs and cdc_get_dataset_schema to inspect columns before querying.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupNoSoQL GROUP BY clause. Requires aggregate functions in select.
limitNoMax rows to return (default 100, max 5000). Fewer come back when the page would cross the 200,000-character response budget; the response says so and gives a nextOffset to resume from.
orderNoSoQL ORDER BY clause. Field name with optional ASC/DESC: "total_deaths DESC". Set one whenever paging with offset: SODA does not order results implicitly, so consecutive offsets without a deterministic order can skip or repeat rows. When the dataset has no natural unique column, Socrata's documented minimum tie-breaker is the system field `:id`, present on every dataset — order=":id".
whereNoSoQL WHERE clause. Strings must be single-quoted: "state='California' AND year=2020". If a column name matches a SoQL keyword (group, select, where, order, limit, offset, having, search), wrap it in backticks: "`group`='By Year'".
domainNoCDC Socrata host to query. "data.cdc.gov" (default) and "chronicdata.cdc.gov" front the same catalog, so a four-by-four ID returns the same rows from either and the default works whichever host the dataset was found on.data.cdc.gov
havingNoSoQL HAVING clause. Filters aggregated results.
offsetNoRow offset for pagination (max 1,000,000). Pair with a deterministic order clause — an offset walk over unordered results can skip or repeat rows.
searchNoFull-text search across all text columns. For precise filtering use the where parameter instead.
selectNoSoQL SELECT clause — column names, aliases, or aggregates: "state, sum(deaths) as total_deaths". Omit for all columns. To enumerate distinct values of a column, set select to "{column}, count(*) as count" with group="{column}" and order="count DESC".
datasetIdYesFour-by-four dataset identifier (e.g., "bi63-dtpu"). Obtain from cdc_discover_datasets.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe requested limit that bounded this response.
rowsNoResult rows with requested fields. Most values are strings (including numbers/dates); geo columns return GeoJSON objects.
errorNoPresent when the call failed. Absent on success.
shownNoNumber of rows returned in this response.
noticeNoGuidance when no rows matched, when further rows remain, or when the response budget cut the page short — how to verify filters, resume paging, or broaden the query.
rowCountNoNumber of rows returned in this response.
truncatedNoTrue when rows exist beyond the ones returned, established by fetching one row more than the limit rather than inferred from the row count. Absent means this response is the complete remainder of the result set.
nextOffsetNoOffset to pass on the next call to resume immediately after the last row returned. Present only when further rows exist and the resume point is within the offset ceiling; a deterministic order clause is what makes the walk gap-free.
effectiveQueryNoThe SoQL clauses sent to Socrata, as `$clause=value` pairs joined by "&". Values read exactly as they were supplied — not URL-encoded — so a clause can be copied back into the matching parameter of another call.

TDQS

A4.1/5.0
Behavior3/5

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

readOnlyHint=true already covers the safety profile, so the description does not need to state that this is a read operation. The main prose adds scope and capability context but does not directly disclose behaviors like response-budget truncation or the need for deterministic ordering; those details are present in the parameter descriptions rather than the main description.

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?

The description is three purposeful sentences: the first states the action and resource, the second summarizes query capabilities, and the third names the prerequisite sibling tools. It is front-loaded and contains no filler.

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 complex SoQL tool with 10 parameters, the definition is exceptionally complete. The schema covers defaults, limits, keyword backticks, deterministic pagination, response-budget behavior, domain equivalence, and a distinct-value recipe, while the output schema covers return structure and the description connects the prerequisite discovery/schema tools.

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 description coverage is 100%, so the baseline is 3 even without further narrative in the main description. The description's capability list loosely maps to parameters like where, group, order, search, and select, but it does not add substantive meaning beyond what the schema already explains.

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 description states a specific verb and resource: 'Execute a SoQL query against any CDC dataset.' It also enumerates capabilities—filtering, aggregation, sorting, full-text search, and field selection—so the agent knows exactly what the tool does and can distinguish it from dataset discovery and schema inspection tools.

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 explicitly points to cdc_discover_datasets for finding dataset IDs and cdc_get_dataset_schema for inspecting columns before querying, giving a clear workflow. It does not explicitly contrast with cdc_query_wonder, but the naming and SoQL focus make the choice reasonably clear.

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.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: discovering datasets, fetching schemas, querying Socrata data, and querying WONDER data. Even though query_dataset and query_wonder both execute queries, they operate on entirely separate systems and are explicitly differentiated in the descriptions, eliminating any ambiguity.

Naming Consistency5/5

All tools follow a consistent cdc_verb_noun pattern: discover_datasets, get_dataset_schema, query_dataset, query_wonder. The naming is uniform, predictable, and clearly indicates the action and target.

Tool Count4/5

Four tools is lean but sufficient for the server's scope: three tools cover the full Socrata dataset lifecycle (discover, schema, query) and one handles the separate WONDER system. The count is slightly on the low end but not inadequate, and each tool is essential.

Completeness4/5

The tool surface covers the primary workflows for searching, inspecting, and querying CDC datasets and WONDER data. Minor gaps exist, such as no direct way to list all datasets without a search, but the provided tools handle the core use cases without dead ends.