Skip to main content
Glama
cyanheads

clinicaltrialsgov-mcp-server

Clinicaltrials Get Study Count

clinicaltrials_get_study_count
Read-onlyIdempotent

Retrieve the total count of clinical trials matching a query from ClinicalTrials.gov. Build breakdowns by phase, status, or condition without downloading full study data.

Instructions

Get total clinical trial study count from ClinicalTrials.gov matching a query, without fetching study data. Fast and lightweight. Use for quick statistics or to build breakdowns by calling multiple times with different filters (e.g., count by phase, count by status, count recruiting vs completed for a condition).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoGeneral free-text search across all fields. Plain words plus AND, OR, NOT only — reserved chars `[ ] ( ) ,` will fail. For field-scoped searches, use the dedicated *Query parameters (conditionQuery, interventionQuery, etc.) or advancedFilter with AREA[FieldName]value.
conditionQueryNoCondition/disease-specific search. E.g., "Type 2 Diabetes", "non-small cell lung cancer". Plain words plus AND/OR/NOT only — reserved chars: [ ] ( ) ,
interventionQueryNoIntervention/treatment search. E.g., "pembrolizumab", "cognitive behavioral therapy". Plain words plus AND/OR/NOT only — reserved chars: [ ] ( ) ,
sponsorQueryNoSponsor/collaborator name search. Plain words plus AND/OR/NOT only — reserved chars: [ ] ( ) ,
statusFilterNoFilter by study status. Values: RECRUITING, COMPLETED, ACTIVE_NOT_RECRUITING, NOT_YET_RECRUITING, ENROLLING_BY_INVITATION, SUSPENDED, TERMINATED, WITHDRAWN, UNKNOWN, WITHHELD, NO_LONGER_AVAILABLE, AVAILABLE, APPROVED_FOR_MARKETING, TEMPORARILY_NOT_AVAILABLE.
phaseFilterNoFilter by trial phase. Values: EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4, NA.
advancedFilterNoAdvanced filter using AREA[FieldName]value syntax. Examples: "AREA[StudyType]INTERVENTIONAL", "AREA[EnrollmentCount]RANGE[100, 1000]", "AREA[Phase]PHASE2 AND AREA[StudyType]INTERVENTIONAL", "(AREA[Phase]PHASE3 OR AREA[Phase]PHASE4) AND AREA[StudyType]INTERVENTIONAL". AND/OR/NOT join complete AREA[FieldName]value expressions; parentheses group them. Call clinicaltrials_get_field_definitions to find AREA[]-compatible field names.
includeUnknownEnrollmentNoInclude studies whose EnrollmentCount is the upstream "unknown" sentinel (99999999). Excluded by default — the sentinel pollutes RANGE[N, MAX] queries. Set true for data-quality audits.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalCountYesTotal studies matching the query/filters.
searchCriteriaNoEcho of query/filter criteria used.
noMatchHintsNoSuggestions when no studies match (totalCount is 0).
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent, open-world. Description adds that it is fast, lightweight, and does not fetch study data, reinforcing read-only behavior. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences: first explains core function, second adds quality attributes, third provides usage guidance. Every sentence is valuable, front-loaded, and no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (so no need to explain returns), the description thoroughly covers the tool's purpose, usage, and performance characteristics. It is complete for a lightweight count tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description does not add new parameter-level details beyond the schema, adhering to the baseline of 3 for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it gets a count of clinical trials without fetching data, distinguishing it from sibling tools like clinicaltrials_search_studies that return detailed records. Specifies the source (ClinicalTrials.gov) and the action (count).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises to use for quick statistics and building breakdowns by calling multiple times with different filters, providing concrete examples (by phase, status, condition). This guides when to use and hints at the pattern for multiple calls.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/clinicaltrialsgov-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server