Skip to main content
skill CX Codex

clinical-trials-search — Claude Code skill: clinical trial search

clinical-trials-search searches ClinicalTrials.gov using natural language queries via Valyu semantic search API.

MIT 174 installs ★ 64 updated 2026-10-04

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add yorkeccak/scientific-skills --skill clinical-trials-search -a claude-code
Open on GitHub

What clinical-trials-search does

The skill queries the full ClinicalTrials.gov database and returns JSON with phases, conditions, interventions and outcomes. Pass queries as plain text — no parameter parsing. Semantic search interprets meaning, not just keywords. You need a Valyu API key (10 dollars free credits on signup). The skill installs scripts to ~/.claude/skills/clinical-trials-search/scripts/, and you must set the key with scripts/search setup <key> before the first search. The bash wrapper calls Node.js with built-in fetch(), zero external dependencies.

What it helps with

  • find active trials for a disease or therapy
  • compare eligibility criteria across several studies
  • extract safety and outcome data from completed trials
  • match patients to clinical study enrollment
  • check trial recruitment status and phase

Example prompts for the agent

  • find phase 2 trials for Alzheimer's disease
  • show checkpoint inhibitor combinations in lung cancer, 20 results
  • extract all CAR-T therapy trial URLs with jq -r '.results[].url'

How to install clinical-trials-search

1Skills CLI (Vercel)

npx skills add yorkeccak/scientific-skills --skill clinical-trials-search -a claude-code

2Manually: put the files in place

~/.claude/skills/clinical-trials-search/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/clinical-trials-search/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about clinical-trials-search

How to install clinical-trials-search in Claude Code?

Run npx skills add yorkeccak/scientific-skills --skill clinical-trials-search -a claude-code, then open ~/.claude/skills/clinical-trials-search/SKILL.md.

What does clinical-trials-search do?

Searches ClinicalTrials.gov with semantic queries, returns JSON containing phase, conditions, interventions and outcomes.

Do I need a paid key?

Valyu gives 10 dollars of free credits on signup, enough for hundreds of queries. You can top up after using the free credit.

Source text

SKILL.md · MIT
---
name: clinical-trials-search
description: Search ClinicalTrials.gov with natural language queries. Find clinical trials, enrollment, and outcomes using Valyu semantic search.
keywords:
  - clinical-trials
  - trial-search
  - patient-recruitment
  - clinical-research
  - trial-outcomes
  - semantic-search
license: MIT
---


# Clinical Trials Search

Search the complete ClinicalTrials.gov database of clinical studies using natural language queries powered by Valyu's semantic search API.

## Why This Skill is Powerful

- **No API Parameter Parsing**: Just pass natural language queries directly - no need to construct complex search parameters
- **Semantic Search**: Understands the meaning of your query, not just keyword matching
- **Full-Text Access**: Returns complete trial information including phases, conditions, interventions, and outcomes
- **Image Links**: Includes data visualizations when available
- **Comprehensive Coverage**: Access to all ClinicalTrials.gov data

## Requirements

1. Node.js 18+ (uses built-in fetch)
2. Valyu API key from https://platform.valyu.ai ($10 free credits)

## CRITICAL: Script Path Resolution

The `scripts/search` commands in this documentation are relative to this skill's installation directory.

Before running any command, locate the script using:

```bash
CLINICAL_TRIALS_SCRIPT=$(find ~/.claude/plugins/cache -name "search" -path "*/clinical-trials-search/*/scripts/*" -type f 2>/dev/null | head -1)
```

Then use the full path for all commands:
```bash
$CLINICAL_TRIALS_SCRIPT "CAR-T cell therapy trials" 15
```

## API Key Setup Flow

When you run a search and receive `"setup_required": true`, follow this flow:

1. **Ask the user for their API key:**
   "To search ClinicalTrials.gov, I need your Valyu API key. Get one free ($10 credits) at https://platform.valyu.ai"

2. **Once the user provides the key, run:**
   ```bash
   scripts/search setup <api-key>
   ```

3. **Retry the original search.**

## When to Use This Skill

- Finding ongoing and completed clinical trials
- Identifying trial eligibility criteria
- Recruiting status and enrollment information
- Comparing treatment approaches in trials
- Patient recruitment and enrollment research
- Outcomes and safety data from trials
## Output Format

```json
{
  "success": true,
  "type": "clinical_trials_search",
  "query": "CAR-T cell therapy trials",
  "result_count": 10,
  "results": [
    {
      "title": "Trial Title",
      "url": "https://clinicaltrials.gov/...",
      "content": "Trial details, phase, conditions, outcomes...",
      "source": "clinical-trials",
      "relevance_score": 0.95,
      "images": []
    }
  ],
  "cost": 0.025
}
```

## Processing Results

### With jq

```bash
# Get trial titles
scripts/search "query" 10 | jq -r '.results[].title'

# Get URLs
scripts/search "query" 10 | jq -r '.results[].url'

# Extract full content
scripts/search "query" 10 | jq -r '.results[].content'
```

## Common Use Cases

### Drug Development

```bash
# Find drug trials
scripts/search "phase 2 trials for Alzheimer's disease" 50
```

### Treatment Research

```bash
# Search for treatment studies
scripts/search "checkpoint inhibitor combinations in lung cancer" 20
```

### Medical Device Studies

```bash
# Find device trials
scripts/search "continuous glucose monitoring device studies" 15
```

### Intervention Analysis

```bash
# Search for intervention studies
scripts/search "behavioral interventions for obesity" 25
```


## Error Handling

All commands return JSON with `success` field:

```json
{
  "success": false,
  "error": "Error message"
}
```

Exit codes:
- `0` - Success
- `1` - Error (check JSON for details)

## API Endpoint

- Base URL: `https://api.valyu.ai/v1`
- Endpoint: `/search`
- Authentication: X-API-Key header

## Architecture

```
scripts/
├── search          # Bash wrapper
└── search.mjs      # Node.js CLI
```

Direct API calls using Node.js built-in `fetch()`, zero external dependencies.

## Adding to Your Project

If you're building an AI project and want to integrate Clinical Trials Search directly into your application, use the Valyu SDK:

### Python Integration

```python
from valyu import Valyu

client = Valyu(api_key="your-api-key")

response = client.search(
    query="your search query here",
    included_sources=["valyu/valyu-clinical-trials"],
    max_results=20
)

for result in response["results"]:
    print(f"Title: {result['title']}")
    print(f"URL: {result['url']}")
    print(f"Content: {result['content'][:500]}...")
```

### TypeScript Integration

```typescript
import { Valyu } from "valyu-js";

const client = new Valyu("your-api-key");

const response = await client.search({
  query: "your search query here",
  includedSources: ["valyu/valyu-clinical-trials"],
  maxResults: 20
});

response.results.forEach((result) => {
  console.log(`Title: ${result.title}`);
  console.log(`URL: ${result.url}`);
  console.log(`Content: ${result.content.substring(0, 500)}...`);
});
```

See the [Valyu docs](https://docs.valyu.ai) for full integration examples and SDK reference.

© yorkeccak · MIT · yorkeccak/scientific-skills

Similar skills

All skills for Science and research →
clinical-trials-database google-deepmind clinical-trials-database queries ClinicalTrials.gov via REST API v2 to search studies by condition, drug, status, or phase. Saves filtered study data directly to JSON. CX Codex +1 2,600installs Clinical Trials Data Server plainyogurt21 Clinical Trials Data Server — an MCP server that exposes ClinicalTrials.gov data directly in your code editor. Search trials by condition, intervention, or sponsor; pull full details and run statistical breakdowns by phase. CX Codex +1 5,823installs clinical-decision-support K-Dense-AI Builds and checks research-only clinical decision-support artifacts: evidence profiles, cohorts, survival plans, de-identification. Not for patient care. CX Codex +1 2,100installs PepBank Peptide Research MCP: BPC-157, Retatrutide and Tirzepatide Studies and Trials pepbank PepBank Peptide Research MCP: BPC-157, Retatrutide and Tirzepatide Studies and Trials is a Claude Code MCP server that searches peptide studies and clinical trials, compares evidence, and returns source links. CX Codex +1 tooluniverse-clinical-trial-design mims-harvard The tooluniverse-clinical-trial-design skill scores a clinical trial design across six dimensions and returns a feasibility report with enrollment projections. CX Codex +1 463installs tooluniverse-clinical-trial-matching mims-harvard The tooluniverse-clinical-trial-matching skill turns a patient's molecular profile and clinical state into a ranked list of clinical trials with evidence tiers and match scores. CX Codex +1 411installs

From the same set13

The whole set →
pubmed-search pubmed-search is a Claude Code skill for natural-language semantic search across PubMed. It returns full article texts and figures for literature reviews. CX Codex +1 711installs patents-search patents-search searches patents worldwide from plain-language queries. Useful for prior art, technology landscapes and tracking what competitors file. CX Codex +1 641installs literature-search literature-search — a Claude Code skill that queries PubMed, arXiv, bioRxiv and medRxiv together using plain-language phrases. One command returns full texts, figures and relevance scores from all four databases. CX Codex +1 605installs medrxiv-search medrxiv-search is a Claude Code skill that searches medRxiv medical preprints with plain-language queries and retrieves full article text. It supports searches for clinical and epidemiological research. CX Codex +1 196installs drug-discovery-search drug-discovery-search is a Claude Code skill for natural-language searches of compounds, targets, and drug information. It supports target research, compound optimization, and safety assessment. CX Codex +1 169installs biorxiv-search biorxiv-search is a Claude Code skill that searches bioRxiv preprints using natural-language queries. It returns full texts, figures, and relevance scores. CX Codex +1 150installs drug-labels-search drug-labels-search is a skill for Claude Code that searches official FDA drug labels via the Valyu API, returning relevant sections for natural-language queries. CX Codex +1 137installs drugbank-search drugbank-search is a Claude Code skill that searches DrugBank for medicines, interactions, mechanisms of action, and targets. It answers plain-language questions about these topics. CX Codex +1 136installs

Project sponsors

Companies that keep this analytics open