Skip to main content
Glama
BACH-AI-Tools

Clinical Trials MCP Server

search_studies

Find clinical trials by condition, intervention, location, phase, status, and eligibility criteria to identify relevant research studies.

Instructions

Search for clinical trials with various filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoGeneral search term (condition, intervention, etc.)
conditionNoMedical condition or disease
interventionNoTreatment, drug, or intervention
locationNoGeographic location (city, state, country)
phaseNoStudy phase (PHASE1, PHASE2, PHASE3, PHASE4, NA)
statusNoRecruitment status
sexNoSex eligibility
ageNoAge group
pageSizeNoNumber of results to return (default 10, max 100)

Implementation Reference

  • Implementation of the search_studies tool handler.
    async handleSearchStudies(args) {
        const params = {
            format: "json",
            pageSize: args?.pageSize || 10,
        };
        // Build query parameters based on arguments
        if (args?.query) {
            params["query.term"] = args.query;
        }
        if (args?.condition) {
            params["query.cond"] = args.condition;
        }
        if (args?.intervention) {
            params["query.intr"] = args.intervention;
        }
        if (args?.location) {
            params["query.locn"] = args.location;
        }
        if (args?.phase) {
            params["filter.phase"] = args.phase;
        }
        if (args?.status) {
            params["filter.overallStatus"] = args.status;
        }
        if (args?.sex) {
            params["filter.sex"] = args.sex;
        }
        if (args?.age) {
            params["filter.stdAge"] = args.age;
        }
        try {
            const response = await this.axiosInstance.get("/studies", { params });
            const studies = response.data.studies || [];
            const results = studies.map((study) => this.formatStudySummary(study));
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify({
                            totalCount: response.data.totalCount || 0,
                            resultsShown: results.length,
                            studies: results,
                        }, null, 2),
                    },
                ],
            };
        }
        catch (error) {
            if (axios.isAxiosError(error)) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Clinical Trials API error: ${error.response?.data?.message || error.message}`,
                        },
                    ],
                    isError: true,
                };
            }
            throw error;
        }
    }
  • build/index.js:48-105 (registration)
    Definition and registration of the search_studies tool in the ListToolsRequest handler.
    {
        name: "search_studies",
        description: "Search for clinical trials with various filters",
        inputSchema: {
            type: "object",
            properties: {
                query: {
                    type: "string",
                    description: "General search term (condition, intervention, etc.)",
                },
                condition: {
                    type: "string",
                    description: "Medical condition or disease",
                },
                intervention: {
                    type: "string",
                    description: "Treatment, drug, or intervention",
                },
                location: {
                    type: "string",
                    description: "Geographic location (city, state, country)",
                },
                phase: {
                    type: "string",
                    description: "Study phase (PHASE1, PHASE2, PHASE3, PHASE4, NA)",
                    enum: ["PHASE1", "PHASE2", "PHASE3", "PHASE4", "NA"],
                },
                status: {
                    type: "string",
                    description: "Recruitment status",
                    enum: [
                        "RECRUITING",
                        "NOT_YET_RECRUITING",
                        "COMPLETED",
                        "TERMINATED",
                        "SUSPENDED",
                        "WITHDRAWN",
                    ],
                },
                sex: {
                    type: "string",
                    description: "Sex eligibility",
                    enum: ["ALL", "FEMALE", "MALE"],
                },
                age: {
                    type: "string",
                    description: "Age group",
                    enum: ["CHILD", "ADULT", "OLDER_ADULT"],
                },
                pageSize: {
                    type: "number",
                    description: "Number of results to return (default 10, max 100)",
                    minimum: 1,
                    maximum: 100,
                },
            },
        },
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions 'various filters' but doesn't describe what the search returns (list of studies? metadata?), pagination behavior beyond the pageSize parameter, rate limits, authentication requirements, or whether this is a read-only operation. For a search tool with no annotation coverage, this leaves significant gaps.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point. It's appropriately sized for what it communicates, though it could be more informative given the tool's complexity and sibling context. No wasted words or unnecessary elaboration.

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

Completeness2/5

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

Given the tool's complexity (9 parameters, no output schema, no annotations, and 16 sibling alternatives), the description is inadequate. It doesn't explain what the search returns, how results are ordered, whether all parameters are optional, or how this differs from other search tools. The description should provide more context about this tool's specific role in the ecosystem.

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 the schema already documents all 9 parameters thoroughly with descriptions and enums. The description adds no additional parameter semantics beyond mentioning 'various filters' which is already evident from the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Search for clinical trials with various filters' clearly states the verb (search) and resource (clinical trials), but it's vague about scope and doesn't differentiate from the 16 sibling tools that also search or retrieve studies. It doesn't specify what makes this tool distinct from alternatives like search_by_condition or search_by_intervention.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus the many sibling alternatives. With 16 other study-related tools, the description offers no context about when this general search is preferable to more specific searches like search_by_condition or get_recruiting_studies. There's no mention of prerequisites or limitations.

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/BACH-AI-Tools/ClinicalTrials-MCP-Server'

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