[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [ClinicalTrials.gov trial search](https://spiral.ai/integrations/opencode/clinicaltrials-gov-trial-search)

# How to Use ClinicalTrials.gov trial search in opencode

Returns matching study summaries with NCT identifiers, sponsors, status, dates, and other trial characteristics. Use it to discover studies for a condition, sponsor, or location before examining individual records.

|  |  |
| --- | --- |
| Model | ClinicalTrials.gov trial search |
| 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 ClinicalTrials.gov trial search in opencode

- Use ClinicalTrials.gov trial search to find recruiting breast cancer studies in Boston and populate this project's trial table with NCT identifiers, sponsors, and dates.
- Use ClinicalTrials.gov trial search to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from ClinicalTrials.gov trial search and tell me what changed since last week.
- Check ClinicalTrials.gov trial search and summarize what you find in three bullet points.
- Pull the newest data from ClinicalTrials.gov trial search and give me the result as a table.

## How to set up ClinicalTrials.gov trial search in opencode

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

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode 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 ClinicalTrials.gov trial search**: 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": "clinicaltrials-gov/clinical-trials/search",
    "input": {
      "near": {}
    }
  }'
```

Then paste one of the prompts above: opencode finds ClinicalTrials.gov trial search on Spiral, shows the price and runs it.

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

## ClinicalTrials.gov trial search tools and prices

- [ClinicalTrials.gov · Search](https://spiral.ai/tools/alexandria/clinicaltrials-gov/clinical-trials/search) (Alexandria): $0.00873 per call.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| near |  | — | Only studies with a site within the radius of the coordinate (filter.geo=distance(lat,lon,radius)). |
| term |  | — | Other terms searched across the record (query.term). Accepts Essie expressions such as AREA[StartDate]RANGE[2025-01-01,MAX]. |
| title |  | — | Words in the brief or official title, or acronym (query.titles). |
| status |  | — | Overall status filter (filter.overallStatus); any of the listed values matches. |
| sponsor |  | — | Sponsor or collaborator name (query.spons), e.g. "Merck". |
| location |  | — | Location terms: city, state, country or facility (query.locn), e.g. "Boston". |

## What can you do with ClinicalTrials.gov trial search in opencode?

Build a trial research interface around ClinicalTrials.gov's registered terminology and public study evidence. Use the returned data to populate search controls, comparison tables, and explanations of registry categories.

### Build a public trial explorer

Provide registry autocomplete, explain phase and status categories with registry-wide counts, display matching trials, open their protocols, and compare milestones with actual or estimated labels.

### Compare a disease portfolio with registry activity

Resolve the registry's condition wording, collect matching trials, and summarize their phases, designs, and milestones. Present registry-wide phase and status counts separately as context for the selected disease portfolio.

### Prepare a sponsor pipeline brief

Find a company's registered sponsor name, discover its studies, examine trial designs, and assemble a milestone table. Keep projected completion dates visibly separate from reported actual dates.

### Teach clinical registry analysis

Build an exercise around registry terminology, overall phase and status distributions, a reproducible trial search, protocol interpretation, and the difference between actual and estimated milestones.

### Screen studies for a systematic review

Resolve condition and intervention terminology, collect candidate NCT records, inspect eligibility and outcomes, and check study status and completion dates before deciding which records warrant review.

### Maintain a trial milestone watchlist

Discover relevant studies, compare their current milestones with previously collected values, and inspect the full record when a status or date changes. Report changes as registry updates.

### Assess competing trial activity near a site

Resolve a hospital's registered facility name, find studies around Boston or another proposed location, and inspect eligibility and study timelines to assess overlap in recruitment.

### Create a registry terminology reference

Combine phase and status counts with condition, intervention, sponsor, and facility suggestions. Link terminology explanations to example trial records so analysts can see how the terms appear in practice.

## Overview

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

## ClinicalTrials.gov trial search in other agents

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

## More opencode guides

- [ClinicalTrials.gov study details](https://spiral.ai/integrations/opencode/clinicaltrials-gov-study-details)
- [EMA medicine details](https://spiral.ai/integrations/opencode/ema-medicine-details)
- [ClinicalTrials.gov study dates](https://spiral.ai/integrations/opencode/clinicaltrials-gov-study-dates)
- [EMA medicine documents](https://spiral.ai/integrations/opencode/ema-medicine-documents)
- [ClinicalTrials.gov search suggestions](https://spiral.ai/integrations/opencode/clinicaltrials-gov-search-suggestions)
- [EMA medicine opinions](https://spiral.ai/integrations/opencode/ema-medicine-opinions)

## Questions about ClinicalTrials.gov trial search in opencode

**Can opencode use ClinicalTrials.gov trial search?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run ClinicalTrials.gov trial search like any built-in tool.

**How much does ClinicalTrials.gov trial search cost in opencode?**

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

**Do I need an Alexandria account to use ClinicalTrials.gov trial search in opencode?**

No. Spiral runs ClinicalTrials.gov trial search on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up ClinicalTrials.gov trial search in opencode?**

About two minutes: add the server, then sign in, then check it.

**Does opencode wait while ClinicalTrials.gov trial search runs?**

ClinicalTrials.gov trial search runs in the background. opencode starts the run, checks on it and gives you the json when it's ready.

**Does ClinicalTrials.gov cover every clinical study?**

It includes studies in the United States and many other countries, but coverage is incomplete. Not every study is legally required to register, including some observational studies.

**How current is a study's information?**

Updates depend on submissions from the organizations conducting the studies. For applicable trials covered by the final rule, recruitment-status changes must be submitted within 30 calendar days, so the registry is not a live enrollment feed.

**What does an unknown study status mean?**

ClinicalTrials.gov uses unknown status when certain previously ongoing studies have passed their completion date and their status has not been verified within the past two years. It does not establish that the study is still recruiting.

**Are individual participants' results available?**

ClinicalTrials.gov provides summary-level study results rather than raw data or individual participant-level data. Posted results can include participant flow, baseline characteristics, outcome measures, and adverse events.

**Are completion dates confirmed milestones?**

Only dates labeled actual represent reported events. Estimated completion dates are researchers' projections; primary completion concerns collection of primary-outcome data and can differ from overall study completion.

