/clinicaltrialsgov-mcp-server:clinicaltrialsgov-guidefrom clinicaltrialsgov-mcp-server
Guides query syntax and gates for ClinicalTrials.gov tools: study vs site status, SEARCH[Location], DISTANCE, RANGE, MISSING in advancedFilter, phase counts, partial dates, status vocabulary, and interpreting posted results with group IDs and adverse-event thresholds.
Ships in clinicaltrialsgov-mcp-server. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The ClinicalTrials.gov registry as sponsors and investigators submit it: protocols, recruitment status, sites, eligibility, and posted results. Keyless. Counts move as the registry updates, so date any count you report.
geoFilter, location.near on clinicaltrials_find_eligible, nearLocation, and DISTANCE[] in advancedFilter take decimal latitude and longitude, so resolve a place name with a geocoding tool first.| Identifier | Comes from | Goes to |
|---|---|---|
| NCT ID | clinicaltrials_search_studies and clinicaltrials_find_eligible results, or the user | clinicaltrials_get_study_record, clinicaltrials_get_study_results, nctIds on search, clinicaltrials://{nctId} |
Piece name (LeadSponsorName) | clinicaltrials_get_field_definitions piece: search mode by concept, drill mode by section (with includeIndexedOnly it adds the index-only pieces such as NumLocations, which search mode never lists). Copy it exactly as returned | Search fields: any record piece, groups included; an index-only piece comes back as an empty module, so the tool refuses it there. AREA[…] and clinicaltrials_get_field_values: leaf pieces only, so LeadSponsor is refused where LeadSponsorName works. clinicaltrials_get_field_values also takes index-only pieces (NumLocations), record alt names (OVERALL-STATUS), and a name in another case (numlocations, which the registry itself rejects), but not a search area such as ConditionSearch. sort: date and numeric leaves only (type NormalizedDate, PartialDate, DateTimeMinutes, integer, long, or short), or @relevance. In fields on either tool, the full path printed beside the piece (protocolSection.statusModule.overallStatus) works as the piece |
Enum value (RECRUITING, PHASE3, OLDER_ADULT) | clinicaltrials_get_field_values topValues | statusFilter, phaseFilter, AREA[Piece]VALUE |
nextPageToken | clinicaltrials_search_studies | pageToken, with the same criteria |
Results group ID (OG000, EG001, FG000, BG002) | the group list of the same results section | that section only (see Gates) |
| PMID | ReferencePMID, references[].pmid on a record, or resultPublications[].pmid from clinicaltrials_get_study_results | a PubMed tool |
Study status is not site status. statusFilter matches the study's overall status. A RECRUITING study can list a site near the patient that is NOT_YET_RECRUITING or ACTIVE_NOT_RECRUITING, and the compact index shows one site per study (the nearest to geoFilter, else the lead registered site) with that site's own status in brackets, which says nothing about the study's other sites. Before telling someone a trial recruits near them, confirm the status of the site near them: bind it in advancedFilter with SEARCH[Location](…) (see Syntax), read it from clinicaltrials_get_study_record with nearLocation, which shows each site's status, or read it on the sites clinicaltrials_find_eligible returns. When none of a candidate's matched sites recruits, find_eligible adds one recruiting site, which carries distanceMi and can be far from the patient. Two AREA terms outside SEARCH[Location] can match two different sites of one study.
Location pieces return every site. fields with any Location* piece returns the study's full site list, and multinational trials register hundreds of sites, some over a thousand: two such studies can make a response of hundreds of KB. For one study's nearby sites, use clinicaltrials_get_study_record with nearLocation and locationLimit.
Phase counts overlap. A study registered as PHASE2 and PHASE3 matches each phase on its own, so per-phase counts sum above the total. Count the combined studies with AREA[Phase]PHASE2 AND AREA[Phase]PHASE3 and report them, or count a union with OR. Observational studies carry no phase, so a phase breakdown covers interventional studies only.
RANGE skips studies without the field. AREA[X]RANGE[…] matches only studies that publish X. A large share of recruiting trials publish no MaximumAge (no upper age limit), so AREA[MaximumAge]RANGE[65 years, MAX] drops all of them. Add the missing arm, (AREA[MaximumAge]RANGE[65 years, MAX] OR AREA[MaximumAge]MISSING), or filter on StdAge (CHILD, ADULT, OLDER_ADULT), which already counts open-ended limits: among recruiting trials, AREA[StdAge]OLDER_ADULT matches exactly the studies that pair does.
A month-only date sorts as the 1st. Dates are registered as yyyy-MM-dd or yyyy-MM. A yyyy-MM date falls in a RANGE as the first day of its month, so RANGE[2015-06-15, 2015-06-30] misses every study registered as 2015-06. Bin by whole months or years: AREA[StartDate]RANGE[2015-01-01, 2015-12-31].
Enrollment and dates can be projections. The compact index's enrollmentCount, startDate, and primaryCompletionDate carry no ACTUAL/ESTIMATED qualifier. A recruiting trial's enrollment is its target (EnrollmentType ESTIMATED), and any date may be planned rather than actual. clinicaltrials_get_study_record shows each date's type and enrollmentInfo.type; on search, request EnrollmentType, StartDateType, or PrimaryCompletionDateType in fields.
A lead sponsor needs AREA[LeadSponsorName]. sponsorQuery also matches collaborators and the organization name. AREA[LeadSponsorName]Pfizer is a word match: it also catches names such as "Wyeth is now a wholly owned subsidiary of Pfizer". Look at the LeadSponsorName values you are counting before attributing them to one company.
Read status values for what they mean. UNKNOWN marks a study whose status has not been verified in over two years; its LastKnownStatus (RECRUITING, NOT_YET_RECRUITING, ACTIVE_NOT_RECRUITING, ENROLLING_BY_INVITATION) is what it last reported, so count it as neither active nor finished. AVAILABLE, NO_LONGER_AVAILABLE, TEMPORARILY_NOT_AVAILABLE, and APPROVED_FOR_MARKETING occur only on expanded-access records (StudyType EXPANDED_ACCESS), never on trials.
No posted results is not no results. hasResults is true only when results were posted to the registry, and most COMPLETED studies have none. Many report results in a journal instead: a reference with ReferenceType RESULT carries that paper's PMID, and a few carry a citation and no PMID. clinicaltrials_get_study_results answers a study without posted results with resultPublications, its RESULT references in registry order, each with pmid, citation, and retractions when a notice is linked; BACKGROUND and DERIVED references are not listed there. Before saying a trial has no results, check resultPublications (or the record's references) and pass the PMIDs to a PubMed tool.
Results group IDs belong to one section. Outcomes use OG…, adverse events EG…, participant flow FG…, and baseline BG…, and each section defines its own groups: a study can report two outcome groups and four event groups. Match arms across sections by group title, never by the number in the ID.
Other adverse events stop at a threshold. Serious events are reported however rare; other (non-serious) events only at or above the study's frequencyThreshold, usually a percentage (5, 0.5) and in rare records text (any). An event absent from otherEvents may have occurred below it. Summary and full mode both carry the threshold, so read it before saying an event did not occur.
advancedFilter takes these Essie expressions:
| Expression | Matches |
|---|---|
AREA[Condition]breast cancer | every word within that field, each widened by the registry's synonyms; quoting (AREA[Condition]"breast cancer") keeps the words together but still matches synonyms such as Breast Neoplasms, and AREA[Condition]EXPANSION[Term]"breast cancer" drops them |
AREA[StartDate]RANGE[2020-01-01, MAX] | an inclusive range; MIN and MAX leave an end open; dates are yyyy-MM-dd. RANGE takes date, numeric, and age fields only (StartDate, EnrollmentCount, MinimumAge), and every other field a value. NCT IDs follow first-posting order, so bound an ID range as a StudyFirstPostDate window |
AREA[MaximumAge]RANGE[MIN, 2 years] | ages compared across units on a 7-day week, a 30-day month, and a 360-day year: 24 months matches the same studies, and 6480 days the same as 18 years, while 6570 days (18 calendar years) reads as 18.25 years |
AREA[MaximumAge]MISSING | studies that do not publish the field |
SEARCH[Location](AREA[LocationCity]Seattle AND AREA[LocationStatus]RECRUITING) | every term inside holding for the same site. Only a site's own fields go inside (LocationFacility, LocationCity, LocationState, LocationZip, LocationCountry, LocationStatus, the LocationContact… fields); a study-level field such as OverallStatus or NumLocations goes beside the wrapper, AREA[OverallStatus]RECRUITING AND SEARCH[Location](…), and a search area such as LocationSearch is unknown inside it. No DISTANCE[] or RANGE[] term goes inside the wrapper (either fails as field_invalid; outside the wrapper, too, RANGE[] takes no site field but the count NumLocationContacts): a radius goes beside the wrapper, AREA[LocationGeoPoint]DISTANCE[47.6062,-122.3321,25mi] AND SEARCH[Location](…), where it can match a different site of the study than the wrapper's other terms, and a site field is matched by value, OR-joined inside the wrapper, SEARCH[Location](AREA[LocationZip]98101 OR AREA[LocationZip]98102) |
AREA[LocationGeoPoint]DISTANCE[47.6062,-122.3321,25mi] | studies with any site within the radius, the same studies geoFilter matches. LocationGeoPoint is the only field DISTANCE[] takes, and the radius runs 1 to 500 mi or 1 to 805 km, written with its unit (25mi, 40km); past that it fails as query_parse_error, and geoFilter on clinicaltrials_search_studies or clinicaltrials_get_study_count, or location.near on clinicaltrials_find_eligible, takes a larger one. A bare DISTANCE[] with no AREA[…] before it fails as field_invalid |
AREA[OverallStatus]COMPLETED AND NOT AREA[HasResults]true | AND, OR, NOT between whole expressions; parentheses group |
Recruiting trials near a place. Geocode the place, then call clinicaltrials_search_studies with geoFilter, the condition, statusFilter RECRUITING, and any phase. geoFilter admits a study when any of its sites falls in the radius, whatever that site's status, so read the status in brackets on each candidate's nearest site, and where it is not RECRUITING check the in-radius sites with clinicaltrials_get_study_record and nearLocation before presenting the study. For a named city with no radius, bind city and site status together with SEARCH[Location](…) in advancedFilter instead. For one patient, clinicaltrials_find_eligible takes the radius as location: { country, near: { lat, lon, radiusMi } } (radiusMi at least 1, default 50; no two points on Earth are farther apart than 12,451 mi, so a larger radius is sent as 12451 and reaches the same sites) and returns each candidate's sites within the radius, nearest first, each with distanceMi from the patient; when no site measures inside the radius, the nearest measured site stands alone, and one added recruiting site can lie past it, added when no listed site recruits or when none is in country while a site there recruits. near replaces city and state: either beside it fails as location_conflict. country is still required, but it is matched on any one site of the study, separately from the radius, so a candidate's sites in range can all lie in another country (Detroit sites for a patient in Windsor, Ontario): read each site's country before presenting it to a patient who must enroll at home.
Counts and trends. Make one clinicaltrials_get_study_count call per bucket (status, phase, year, sponsor class). clinicaltrials_get_field_values gives the vocabulary and registry-wide counts only; it cannot be scoped to a query. clinicaltrials_get_study_count takes geoFilter at any radius (a radius past 12,451 mi or 20,039 km is sent at that cap and the notice says so) and takes no nctIds. AREA[LocationGeoPoint]DISTANCE[lat,lon,radius] in its advancedFilter counts the same studies, with the radius stopping at 500 mi or 805 km. For trends by year, bin StartDate (planned for studies not yet started) or StudyFirstPostDate (when the record was first posted), per the month-only date gate.
Screening candidates for one patient. clinicaltrials_find_eligible never reads inclusion or exclusion criteria. Fetch the candidates' criteria with clinicaltrials_search_studies: nctIds set to the candidate IDs, fields to NCTId, EligibilityCriteria, MinimumAge, and MaximumAge, and pageSize at least the number of candidates, since a page otherwise stops at 10 studies. Follow nextPageToken while one appears, and fetch any deferredNctIds the same way. Read each candidate's criteria against the patient and present the ones that survive as possible matches for the patient's care team to confirm.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
clinicaltrials-gov, clinical-trials, query-syntax, trial-data, registry
clinicaltrialsgov-mcp-server@cyanheads is listed by cyanheads/cyanheads — review the source before installing
npx claudepluginhub cyanheads/cyanheads --plugin clinicaltrialsgov-mcp-serverOther plugins' skills for the same job