[Integrations](https://spiral.ai/integrations) › [Grok](https://spiral.ai/integrations/grok) › [CMS drug spending records](https://spiral.ai/integrations/grok/cms-drug-spending-records)

# How to Use CMS drug spending records in Grok

Returns pages of records from a CMS drug spending dataset. Use it to collect a complete dataset for comparisons, historical analysis, or your own calculations.

|  |  |
| --- | --- |
| Model | CMS drug spending records |
| Available through | Alexandria |
| Category | Health |
| Price | $0.00873 per call. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with CMS drug spending records in Grok

- Use CMS drug spending records to compare Ozempic and Jardiance prescription fills across the available annual Part D years and summarize the changes.
- Use CMS drug spending records to look this up and give me the result as a table.
- Pull the latest numbers from CMS drug spending records and tell me what changed since last week.
- Check CMS drug spending records and summarize what you find in three bullet points.
- Pull the newest data from CMS drug spending records and give me the result as a table.

## How to set up CMS drug spending records in Grok

Pick the way that suits you. Each takes about two minutes.

### Use the Grok connector

1. **Add a custom connector**: In Grok open Settings › Connect Apps, then Add a custom connector. Name it Spiral, paste this URL, leave Headers empty and click Add MCP.

```text
https://api.spiral.ai/mcp
```

2. **Sign in to Spiral and approve**: Grok opens Spiral: sign in, pick the organization and click Authorize. Spiral gives the connection its own API key; Grok never sees it, and you can remove the connection under Settings › Connected apps.

3. **Check that it is connected**: Connect Apps › Custom shows Spiral as Connected. It works in every Grok chat and Grok bot.

### Use the Spiral skill

1. **Send Grok this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run CMS drug spending records**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "data-cms-gov/drug-spending/records_list",
    "input": {
      "dataset": "part_d_annual"
    }
  }'
```

Then paste one of the prompts above: Grok finds CMS drug spending records on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/grok

## CMS drug spending records tools and prices

- [CMS data.cms.gov · Records list](https://spiral.ai/tools/alexandria/data-cms-gov/drug-spending/records_list) (Alexandria): $0.00873 per call.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| page_size | 1 to 5000 | — | Source rows per page (default 1000, maximum 5000: the API silently caps larger sizes). Annual pages yield five records per row. |
| continuation |  | — | Opaque cursor from the previous page's meta.page.next_cursor (also derivable from next_offset). Pins the release; a moved release fails with publication_changed. |

## What can you do with CMS drug spending records in Grok?

Create a sourced comparison of CMS spending and prescription fills for drugs such as Eliquis and Ozempic. A chat app can explain the reported measures, including why Part D totals exclude rebates and Medicaid has no beneficiary counts.

### Annual drug spending report

Identify the annual datasets and publication versions, collect the records, rank spending, and investigate named drugs. Recheck the exact records supporting the report's main findings.

### Diabetes drug utilization study

Compare reported spending and prescription fills for drugs such as Ozempic and Jardiance across available years. Establish coverage and publication versions first, then verify the individual records behind notable changes.

### Medicare Part B oncology spending review

Find the relevant Part B publication, rank spending, and examine Keytruda alongside other reported drugs. Collect the underlying records and verify selected results before preparing a fee-for-service spending brief.

### Prescription volume and spending comparison

Use a consistent annual publication to find high-spending drugs and compare their spending changes with prescription-fill changes. Retrieve and verify the records needed to distinguish changes in reported utilization from changes in average spending.

### Medicaid spending concentration analysis

Rank drugs by reported Medicaid spending and use the full dataset to calculate how much the largest drugs contribute to the total. Keep the analysis at the drug and prescription level because beneficiary counts are unavailable.

### Refresh an internal research dataset

Check publication metadata before collecting another copy of annual drug spending records. Compare successive collections to identify which reported drug totals changed.

## Overview

- [Alexandria](https://spiral.ai/providers/alexandria)
- [All Grok guides](https://spiral.ai/integrations/grok)

## CMS drug spending records in other agents

- [Amp](https://spiral.ai/integrations/amp/cms-drug-spending-records)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/cms-drug-spending-records)
- [Claude](https://spiral.ai/integrations/claude-desktop/cms-drug-spending-records)
- [Claude Code](https://spiral.ai/integrations/claude-code/cms-drug-spending-records)
- [Cline](https://spiral.ai/integrations/cline/cms-drug-spending-records)
- [Codex](https://spiral.ai/integrations/codex/cms-drug-spending-records)
- [Cursor](https://spiral.ai/integrations/cursor/cms-drug-spending-records)
- [Devin](https://spiral.ai/integrations/devin/cms-drug-spending-records)
- [dots](https://spiral.ai/integrations/dots/cms-drug-spending-records)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/cms-drug-spending-records)
- [Gemini](https://spiral.ai/integrations/gemini/cms-drug-spending-records)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/cms-drug-spending-records)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/cms-drug-spending-records)
- [goose](https://spiral.ai/integrations/goose/cms-drug-spending-records)
- [Grok Build](https://spiral.ai/integrations/grok-build/cms-drug-spending-records)
- [Hermes](https://spiral.ai/integrations/hermes/cms-drug-spending-records)
- [Instinct](https://spiral.ai/integrations/instinct/cms-drug-spending-records)
- [Manus](https://spiral.ai/integrations/manus/cms-drug-spending-records)
- [Muse](https://spiral.ai/integrations/muse/cms-drug-spending-records)
- [Muse Code](https://spiral.ai/integrations/muse-code/cms-drug-spending-records)
- [n8n](https://spiral.ai/integrations/n8n/cms-drug-spending-records)
- [Notion](https://spiral.ai/integrations/notion/cms-drug-spending-records)
- [OpenClaw](https://spiral.ai/integrations/openclaw/cms-drug-spending-records)
- [opencode](https://spiral.ai/integrations/opencode/cms-drug-spending-records)
- [Perplexity](https://spiral.ai/integrations/perplexity/cms-drug-spending-records)
- [Raycast](https://spiral.ai/integrations/raycast/cms-drug-spending-records)
- [VS Code](https://spiral.ai/integrations/vscode/cms-drug-spending-records)
- [Windsurf](https://spiral.ai/integrations/windsurf/cms-drug-spending-records)
- [Zapier](https://spiral.ai/integrations/zapier/cms-drug-spending-records)

## More Grok guides

- [CMS drug spending record](https://spiral.ai/integrations/grok/cms-drug-spending-record)
- [CMS drug spending search](https://spiral.ai/integrations/grok/cms-drug-spending-search)
- [CMS drug spending rankings](https://spiral.ai/integrations/grok/cms-drug-spending-rankings)
- [CMS home health agencies](https://spiral.ai/integrations/grok/cms-home-health-agencies)
- [CMS drug spending publication status](https://spiral.ai/integrations/grok/cms-drug-spending-publication-status)
- [CMS home health agency details](https://spiral.ai/integrations/grok/cms-home-health-agency-details)

## Questions about CMS drug spending records in Grok

**Can Grok use CMS drug spending records?**

Yes. Add Spiral to Grok as an MCP server, and Grok can find and run CMS drug spending records like any built-in tool.

**How much does CMS drug spending records cost in Grok?**

$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Grok plan is separate.

**Do I need an Alexandria account to use CMS drug spending records in Grok?**

No. Spiral runs CMS drug spending records on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up CMS drug spending records in Grok?**

About two minutes: add a custom connector, then sign in to Spiral and approve, then check that it is connected.

**Does Grok wait while CMS drug spending records runs?**

CMS drug spending records runs in the background. Grok starts the run, checks on it and gives you the json when it's ready.

**Does CMS drug spending cover the entire US drug market?**

No. Annual Part D data summarizes final-action claims for Part D enrollees, Part B spending excludes Medicare Advantage beneficiaries, and Medicaid spending covers outpatient drugs paid for by state Medicaid agencies.

**How often does CMS update annual drug spending data?**

CMS typically updates the annual Medicare Part D spending dataset once every 12 months. That publication schedule describes the annual dataset, rather than current prescribing activity.

**Do the spending totals include rebates?**

Part D totals exclude manufacturer rebates and other price concessions. Medicaid totals likewise are not reduced by rebates paid to states, so these figures do not establish spending after rebates.

**Can I compare spending per beneficiary across Medicare and Medicaid?**

The Medicaid spending dataset does not provide individual beneficiary counts. CMS explicitly says that per-beneficiary calculations are therefore not possible for that dataset.

**Does a Part D drug total describe one strength or dosage form?**

Annual Part D summaries combine strengths, dosage forms, and routes of administration under brand and generic names. A drug-level result therefore does not isolate a particular tablet strength or injection formulation.

