Skip to main content
Glama
BACH-AI-Tools

Clinical Trials MCP Server

search_by_sponsor

Find clinical trials by sponsor or organization to identify research studies funded by specific companies, institutions, or government agencies.

Instructions

Search clinical trials by sponsor or organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sponsorYesSponsor name or organization (e.g., "Pfizer", "National Cancer Institute")
sponsorTypeNoType of sponsor
pageSizeNoNumber of results to return (default 10, max 100)

Implementation Reference

  • The `handleSearchBySponsor` method implements the logic for the `search_by_sponsor` tool. It takes `sponsor` and `sponsorType` as arguments and queries the ClinicalTrials.gov API.
    private async handleSearchBySponsor(args: any) {
      if (!args?.sponsor) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Sponsor parameter is required"
        );
      }
    
      const params: any = {
        format: "json",
        pageSize: args?.pageSize || 10,
        "query.spons": args.sponsor,
      };
    
      if (args?.sponsorType) {
        params["filter.leadSponsorClass"] = args.sponsorType;
      }
    
      try {
        const response: AxiosResponse<StudySearchResponse> =
          await this.axiosInstance.get("/studies", { params });
    
        const studies = response.data.studies || [];
        const results = studies.map((study) => ({
          ...this.formatStudySummary(study),
          sponsorDetails:
            study.protocolSection.sponsorCollaboratorsModule?.leadSponsor,
        }));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  searchCriteria: {
                    sponsor: args.sponsor,
                    sponsorType: args.sponsorType,
                  },
                  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:300-326 (registration)
    The tool `search_by_sponsor` is registered within the `ListToolsRequestSchema` handler in `src/index.ts`. It takes a `sponsor` string and optional `sponsorType` and `pageSize` arguments.
      name: "search_by_sponsor",
      description: "Search clinical trials by sponsor or organization",
      inputSchema: {
        type: "object",
        properties: {
          sponsor: {
            type: "string",
            description:
              'Sponsor name or organization (e.g., "Pfizer", "National Cancer Institute")',
            minLength: 2,
          },
          sponsorType: {
            type: "string",
            description: "Type of sponsor",
            enum: ["INDUSTRY", "NIH", "FED", "OTHER"],
          },
          pageSize: {
            type: "number",
            description:
              "Number of results to return (default 10, max 100)",
            minimum: 1,
            maximum: 100,
          },
        },
        required: ["sponsor"],
      },
    },
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 only states the search action without detailing aspects like whether it's read-only, if it requires authentication, rate limits, pagination behavior (beyond the 'pageSize' parameter), or what the output format looks like. For a search tool with no annotation coverage, this is insufficient.

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 by sponsor or organization.' It is front-loaded with the core purpose, contains no redundant information, and every word earns its place. This is an excellent example of conciseness.

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 (a search tool with 3 parameters) and lack of annotations and output schema, the description is incomplete. It does not explain return values, error conditions, or behavioral traits like pagination or authentication needs. For a tool with no structured output information, the description should provide more context to guide the agent 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?

The input schema has 100% description coverage, providing clear details for all parameters (sponsor, sponsorType, pageSize). The description adds no additional parameter semantics beyond what's in the schema. According to the rules, with high schema coverage (>80%), the baseline score is 3, as the schema adequately documents parameters without needing extra description.

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 by sponsor or organization.' It specifies the verb ('search') and resource ('clinical trials'), and distinguishes the search dimension ('by sponsor or organization'). However, it does not explicitly differentiate from sibling tools like 'search_by_condition' or 'search_by_intervention,' which would be needed for a score of 5.

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 available (e.g., 'search_by_condition,' 'search_by_location'), there is no indication of when sponsor-based searching is appropriate or when other search methods might be better. This lack of context leaves 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