# CDC open data dataset query

Runs a SoQL query on one data.cdc.gov dataset by id: $select columns, $where filters, $group aggregations, $order, $q full-text search, with paging. Needs dataset id.

Runs a SoQL query on one data.cdc.gov dataset by id: $select columns, $where filters, $group aggregations, $order, $q full-text search, with paging. Find dataset ids and column names with cdc/dataset-search.

- Tool ID: `cdc/dataset-query`
- Provider: [CDC](/providers/cdc.md)
- Capability: [Knowledge & research](/tools/knowledge.md)
- Price: no charge per call
- Authentication: an authorised Agentik workspace is required for execution, including zero-price tools.

## Pricing contract

No charge per call. A workspace is still needed so your agent can call it.


```json
{
  "model": "per_call",
  "amountUsd": 0
}
```

## Complete input schema


```json
{
  "type": "object",
  "properties": {
    "dataset_id": {
      "type": "string",
      "pattern": "^[a-z0-9]{4}-[a-z0-9]{4}$",
      "description": "data.cdc.gov dataset id, e.g. 'swc5-untb'"
    },
    "select": {
      "type": "string",
      "maxLength": 500,
      "description": "SoQL $select, e.g. 'year,stateabbr,measure,data_value'"
    },
    "where": {
      "type": "string",
      "maxLength": 1000,
      "description": "SoQL $where, e.g. \"stateabbr='VT' AND year='2023'\""
    },
    "group": {
      "type": "string",
      "maxLength": 300,
      "description": "SoQL $group (with aggregates in select), e.g. 'stateabbr'"
    },
    "order": {
      "type": "string",
      "maxLength": 300,
      "description": "SoQL $order, e.g. 'data_value DESC'"
    },
    "q": {
      "type": "string",
      "maxLength": 200,
      "description": "Full-text search across the dataset, e.g. 'obesity'"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 500,
      "default": 25,
      "description": "Rows to return, e.g. 25"
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000000,
      "description": "Rows to skip, e.g. 25"
    }
  },
  "required": [
    "dataset_id"
  ],
  "additionalProperties": false
}
```

## Published example

This is the provider tool’s published example. Replace example values with the user’s requested inputs, respecting the schema; do not execute an example merely to test a connection.


```json
{
  "tool_id": "cdc/dataset-query",
  "input": {
    "dataset_id": "swc5-untb",
    "select": "year,stateabbr,measure,data_value",
    "where": "stateabbr='VT'",
    "limit": 3
  }
}
```

## Execute and retrieve

Inspect again before execution, explain the price and obtain the required authority. Use MCP run_tool or POST /v1/run with this tool ID, valid input and an idempotency key. Save the returned run ID and follow the actual state. If Agentik answers that the tool is temporarily unavailable, do not retry it blindly; use discovery to propose an alternative.

A partial or uncertain result can still have consumed provider resources. Consult [billing](/docs/billing.md), [idempotency](/docs/idempotency.md) and [asynchronous results](/docs/async.md).

Licence: US Government public data (check each dataset's licence field).

Attribution: Data from the Centers for Disease Control and Prevention (data.cdc.gov).

[Provider documentation](https://dev.socrata.com/docs/queries/)

[REST inspection](https://api.agentik.cc/v1/tools/cdc/dataset-query) · [OpenAPI](/openapi.json) · [Connection guide](/connect.md)

---

[HTML page](/providers/cdc/dataset-query) · [Agent index](/llms.txt)
