# CMS Medicare dataset query

Queries a data.cms.gov dataset version by UUID with keyword search, up to two column filters, column selection and sorting. Needs dataset id.

Queries a data.cms.gov dataset version by UUID with keyword search, up to two column filters, column selection and sorting. 2024 versions: Part D Prescribers by Provider and Drug 9552739e-3d05-4c1b-8eff-ecabf391e2e5; Physician & Other Practitioners by Provider and Service 92396110-2aed-4d63-a6a2-5d6207d46a29. Each year has its own UUID (see the API link of the dataset on data.cms.gov).

- Tool ID: `cms/medicare-dataset-query`
- Provider: [CMS](/providers/cms.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": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
      "description": "Dataset version UUID, e.g. '9552739e-3d05-4c1b-8eff-ecabf391e2e5'"
    },
    "keyword": {
      "type": "string",
      "minLength": 2,
      "maxLength": 120,
      "description": "Full-text keyword across columns, e.g. 'Ozempic'"
    },
    "filter_column": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_]{1,64}$",
      "description": "Column for the first filter, e.g. 'Brnd_Name'"
    },
    "filter_operator": {
      "type": "string",
      "enum": [
        "=",
        "<>",
        ">",
        ">=",
        "<",
        "<=",
        "STARTS_WITH",
        "CONTAINS",
        "ENDS_WITH"
      ],
      "default": "=",
      "description": "Operator for the first filter, e.g. '='"
    },
    "filter_value": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "Value for the first filter (case-sensitive), e.g. 'Ozempic'"
    },
    "filter2_column": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_]{1,64}$",
      "description": "Column for a second filter, e.g. 'Prscrbr_State_Abrvtn'"
    },
    "filter2_operator": {
      "type": "string",
      "enum": [
        "=",
        "<>",
        ">",
        ">=",
        "<",
        "<=",
        "STARTS_WITH",
        "CONTAINS",
        "ENDS_WITH"
      ],
      "default": "=",
      "description": "Operator for the second filter, e.g. '='"
    },
    "filter2_value": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "Value for the second filter, e.g. 'VT'"
    },
    "columns": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_]+(,[A-Za-z0-9_]+)*$",
      "maxLength": 500,
      "description": "Columns to return, e.g. 'Prscrbr_NPI,Prscrbr_Last_Org_Name,Tot_Clms'"
    },
    "sort": {
      "type": "string",
      "pattern": "^-?[A-Za-z0-9_]{1,64}$",
      "description": "Sort column, prefix '-' for descending (text sort), e.g. '-Tot_Clms'"
    },
    "size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 10,
      "description": "Rows to return, e.g. 10"
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000000,
      "description": "Rows to skip, e.g. 10"
    }
  },
  "required": [
    "dataset_id"
  ],
  "additionalProperties": false,
  "dependencies": {
    "filter_column": [
      "filter_value"
    ],
    "filter_value": [
      "filter_column"
    ],
    "filter2_column": [
      "filter2_value"
    ],
    "filter2_value": [
      "filter2_column"
    ]
  }
}
```

## 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": "cms/medicare-dataset-query",
  "input": {
    "dataset_id": "9552739e-3d05-4c1b-8eff-ecabf391e2e5",
    "filter_column": "Brnd_Name",
    "filter_value": "Ozempic",
    "filter2_column": "Prscrbr_State_Abrvtn",
    "filter2_value": "VT",
    "size": 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 (public domain).

Attribution: Data from the Centers for Medicare & Medicaid Services (data.cms.gov).

[Provider documentation](https://data.cms.gov/api-docs)

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

---

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