Skip to main content
Glama

ClinicalTrials.gov MCP by usefulapi

Count matching clinical trials

count_studies
Read-only

Return only the total NUMBER of studies matching a query, without fetching any records. Accepts the same query terms and filters as search_studies (term, condition, intervention, title, location, sponsor, status, geoFilter, advanced). Returns { totalCount }. GET /studies with countTotal=true and pageSize=1.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termNoGeneral full-text 'other terms' query (maps to query.term).
titleNoWords in the study title (maps to query.titles).
statusNoFilter by overall recruitment status (maps to filter.overallStatus). One or more of: ACTIVE_NOT_RECRUITING, COMPLETED, ENROLLING_BY_INVITATION, NOT_YET_RECRUITING, RECRUITING, SUSPENDED, TERMINATED, WITHDRAWN, AVAILABLE, NO_LONGER_AVAILABLE, TEMPORARILY_NOT_AVAILABLE, APPROVED_FOR_MARKETING, WITHHELD, UNKNOWN.
sponsorNoSponsor / collaborator name (maps to query.spons).
advancedNoAdvanced Essie expression applied as an additional filter (maps to filter.advanced).
locationNoStudy location text, e.g. a city/state/country (maps to query.locn).
conditionNoDisease / condition to match (maps to query.cond), e.g. 'diabetes'.
geoFilterNoGeo filter as a raw geo-function string (maps to filter.geo), e.g. 'distance(39.0027,-77.1,50mi)'.
interventionNoTreatment / drug / intervention to match (maps to query.intr).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so safety is covered; the description adds genuinely useful context beyond that: no records are fetched, the exact response shape is { totalCount }, and the underlying call is GET /studies with countTotal=true and pageSize=1. It stops short of noting auth requirements or any rate/result-size caveats.

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 tight sentences, front-loaded with the core distinction (count only, no records) before enumerating the shared parameters and the return shape. Nothing redundant or padded.

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?

Although there is no output schema, the description explicitly declares the return shape ({ totalCount }) and the no-records guarantee, and confirms the shared parameter surface with search_studies. For a read-only count tool with full schema coverage, nothing an agent needs is missing.

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% and every parameter is documented there with its query/filter mapping, so the baseline is 3. The description only enumerates the same parameter names, adding no syntax, format, or interaction semantics beyond what the schema already provides.

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?

States a specific verb and resource ('Return only the total NUMBER of studies') plus the key scope constraint ('without fetching any records'), which cleanly separates it from the sibling search_studies. An agent can identify the tool's job without opening the schema.

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

Usage Guidelines4/5

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

It names search_studies and establishes the selection condition implicitly: same query surface, but no records returned, so an agent routes here when it only needs a count. There is no explicit 'do not use this when...' statement, but the contrast with the sibling is clear enough to guide selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.