Skip to main content
Glama
BACH-AI-Tools

Clinical Trials MCP Server

get_recruiting_studies

Find currently recruiting clinical trials with contact details by filtering medical condition, location, and age group eligibility.

Instructions

Get currently recruiting clinical trials with contact information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionNoMedical condition to filter by
locationNoGeographic location (city, state, country)
ageGroupNoAge group eligibility
pageSizeNoNumber of results to return (default 10, max 50)

Implementation Reference

  • The handleGetRecruitingStudies method implements the logic for the "get_recruiting_studies" tool, querying the ClinicalTrials.gov API for studies with "RECRUITING" status.
    private async handleGetRecruitingStudies(args: any) {
      const params: any = {
        format: "json",
        pageSize: args?.pageSize || 10,
        "filter.overallStatus": "RECRUITING",
      };
    
      if (args?.condition) {
        params["query.cond"] = args.condition;
      }
    
      if (args?.location) {
        params["query.locn"] = args.location;
      }
    
      if (args?.ageGroup) {
        params["filter.stdAge"] = args.ageGroup;
      }
    
      try {
        const response: AxiosResponse<StudySearchResponse> =
          await this.axiosInstance.get("/studies", { params });
    
        const studies = response.data.studies || [];
        const results = studies.map((study) => ({
          ...this.formatStudySummary(study),
          eligibility: {
            sex: study.protocolSection.eligibilityModule?.sex || "Unknown",
            minimumAge:
              study.protocolSection.eligibilityModule?.minimumAge ||
              "Not specified",
            maximumAge:
              study.protocolSection.eligibilityModule?.maximumAge ||
              "Not specified",
            healthyVolunteers:
              study.protocolSection.eligibilityModule?.healthyVolunteers || false,
          },
          locations:
            study.protocolSection.contactsLocationsModule?.locations?.slice(
              0,
              2
            ) || [],
        }));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  searchCriteria: {
                    recruitmentStatus: "RECRUITING",
                    condition: args?.condition,
                    location: args?.location,
                    ageGroup: args?.ageGroup,
                  },
                  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;
      }
    }
  • src/index.ts:368-395 (registration)
    Registration of the "get_recruiting_studies" tool with its input schema definition.
      name: "get_recruiting_studies",
      description:
        "Get currently recruiting clinical trials with contact information",
      inputSchema: {
        type: "object",
        properties: {
          condition: {
            type: "string",
            description: "Medical condition to filter by",
          },
          location: {
            type: "string",
            description: "Geographic location (city, state, country)",
          },
          ageGroup: {
            type: "string",
            description: "Age group eligibility",
            enum: ["CHILD", "ADULT", "OLDER_ADULT"],
          },
          pageSize: {
            type: "number",
            description: "Number of results to return (default 10, max 50)",
            minimum: 1,
            maximum: 50,
          },
        },
      },
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

B3.2/5.0
Behavior2/5

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

There are no annotations, so the description must convey behavioral traits. It mentions contact information and recruiting status but does not disclose pagination, default ordering, output shape, or limitations. This is minimal coverage for a data retrieval tool.

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?

The description is a single front-loaded sentence with no filler. It conveys the core purpose efficiently.

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 has four optional parameters, no output schema, and no annotations, the description is under-specified. It lacks usage guidance and behavioral details necessary for an agent to know when to invoke it and what to expect in response.

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 descriptions cover all four parameters (condition, location, ageGroup, pageSize) with clear explanations and constraints. The description adds no additional parameter semantics, but the schema is sufficient, warranting the baseline score of 3.

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?

The description uses a specific verb ('Get') and resource ('currently recruiting clinical trials') with a differentiator ('with contact information'), clearly distinguishing it from sibling search tools like search_studies or search_by_condition.

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 on when to use this tool versus alternatives such as search_by_location or search_by_condition. The description is a bare statement without any usage context or exclusions.

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