Skip to main content
Glama
BACH-AI-Tools

Clinical Trials MCP Server

search_rare_diseases

Search clinical trials for rare diseases and orphan conditions to find relevant studies and recruitment opportunities.

Instructions

Search clinical trials for rare diseases and orphan conditions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rareDiseaseYesRare disease or orphan condition name
recruitmentStatusNoFilter by recruitment status
pageSizeNoNumber of results to return (default 10, max 100)

Implementation Reference

  • The handler implementation for the 'search_rare_diseases' tool, which searches for rare diseases using the ClinicalTrials.gov API.
    private async handleSearchRareDiseases(args: any) {
      if (!args?.rareDisease) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Rare disease parameter is required"
        );
      }
    
      const params: any = {
        format: "json",
        pageSize: args?.pageSize || 10,
        "query.cond": args.rareDisease,
      };
    
      if (args?.recruitmentStatus) {
        params["filter.overallStatus"] = args.recruitmentStatus;
      }
    
      // Add terms commonly associated with rare diseases
      params["query.term"] = `${args.rareDisease} OR orphan OR rare`;
    
      try {
        const response: AxiosResponse<StudySearchResponse> =
          await this.axiosInstance.get("/studies", { params });
    
        const studies = response.data.studies || [];
        const results = studies.map((study) => ({
          ...this.formatStudySummary(study),
          conditions: study.protocolSection.conditionsModule?.conditions || [],
          eligibility: {
            sex: study.protocolSection.eligibilityModule?.sex || "Unknown",
            minimumAge:
              study.protocolSection.eligibilityModule?.minimumAge ||
              "Not specified",
            maximumAge:
              study.protocolSection.eligibilityModule?.maximumAge ||
              "Not specified",
          },
        }));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  searchCriteria: {
                    rareDisease: args.rareDisease,
                    recruitmentStatus: args?.recruitmentStatus,
                    searchNote: "Includes orphan and rare disease designations",
                  },
                  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:469-495 (registration)
    Tool registration for 'search_rare_diseases' in the list of available tools.
      name: "search_rare_diseases",
      description:
        "Search clinical trials for rare diseases and orphan conditions",
      inputSchema: {
        type: "object",
        properties: {
          rareDisease: {
            type: "string",
            description: "Rare disease or orphan condition name",
            minLength: 2,
          },
          recruitmentStatus: {
            type: "string",
            description: "Filter by recruitment status",
            enum: ["RECRUITING", "NOT_YET_RECRUITING", "COMPLETED"],
          },
          pageSize: {
            type: "number",
            description:
              "Number of results to return (default 10, max 100)",
            minimum: 1,
            maximum: 100,
          },
        },
        required: ["rareDisease"],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'search' but doesn't clarify if this is a read-only operation, whether it requires authentication, what the output format looks like, or any rate limits. For a search tool with no annotations, this is a significant gap in transparency.

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: 'Search clinical trials for rare diseases and orphan conditions.' It's front-loaded with the core purpose and contains no unnecessary words or redundancy, making it highly concise and well-structured.

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 complexity of a search tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of trials, details), how results are formatted, or any behavioral traits like pagination or error handling. This leaves critical gaps for an agent to use the tool 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 (rareDisease, recruitmentStatus, pageSize). The description doesn't add any semantic details beyond what's in the schema, such as examples of rare disease names or how recruitment status affects results. With high schema coverage, a baseline score of 3 is appropriate.

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 tool's purpose: 'Search clinical trials for rare diseases and orphan conditions.' It specifies the verb ('search') and resource ('clinical trials') with a clear scope ('rare diseases and orphan conditions'). However, it doesn't explicitly differentiate from sibling tools like 'search_by_condition' or 'search_studies,' which might overlap in functionality.

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?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling search tools (e.g., 'search_by_condition,' 'search_studies'), there's no indication of whether this tool is specialized for rare diseases, how it differs from general searches, or any prerequisites for use. This leaves the agent to guess based on the name alone.

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