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,
          },
        },
      },
    },
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. It mentions retrieving 'contact information', which adds some context beyond a basic read, but fails to disclose critical behaviors like pagination (implied by 'pageSize' parameter), rate limits, authentication needs, or what 'currently recruiting' entails (e.g., real-time vs. cached data). This is inadequate for a tool with parameters and no 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?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, making it easy to parse quickly.

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 no annotations and no output schema, the description is incomplete. It lacks details on return values (e.g., format of contact information, result structure), error handling, or behavioral constraints like rate limits. For a tool with 4 parameters and many siblings, this leaves significant gaps for an agent to use it effectively.

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 fully documents all parameters. The description adds no additional meaning about parameters beyond implying filtering by recruitment status and contact info inclusion, which is minimal. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Get') and resource ('currently recruiting clinical trials with contact information'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'search_by_condition' or 'search_by_location' that might also retrieve recruiting studies, missing full sibling distinction.

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. With many sibling tools available (e.g., 'search_by_condition', 'search_by_location'), the description lacks any indication of context, prerequisites, or exclusions, leaving the agent without usage direction.

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