Skip to main content
Glama
BACH-AI-Tools

Clinical Trials MCP Server

get_studies_with_results

Find completed clinical trials with published results by filtering for medical conditions, interventions, and completion dates to access study outcomes.

Instructions

Find completed clinical trials that have published results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionNoMedical condition to filter by
interventionNoTreatment or intervention to filter by
completedAfterNoFind studies completed after this date (YYYY-MM-DD)
pageSizeNoNumber of results to return (default 10, max 100)

Implementation Reference

  • Handler function for the 'get_studies_with_results' tool, which fetches completed trials with results from the ClinicalTrials.gov API.
    private async handleGetStudiesWithResults(args: any) {
      const params: any = {
        format: "json",
        pageSize: args?.pageSize || 10,
        "filter.overallStatus": "COMPLETED",
        "filter.hasResults": true,
      };
    
      if (args?.condition) {
        params["query.cond"] = args.condition;
      }
    
      if (args?.intervention) {
        params["query.intr"] = args.intervention;
      }
    
      if (args?.completedAfter) {
        params["filter.primaryCompletionDateFrom"] = args.completedAfter;
      }
    
      try {
        const response: AxiosResponse<StudySearchResponse> =
          await this.axiosInstance.get("/studies", { params });
    
        const studies = response.data.studies || [];
        const results = studies.map((study) => ({
          ...this.formatStudySummary(study),
          completionDate:
            study.protocolSection.statusModule.primaryCompletionDateStruct?.date,
          hasResults: true,
        }));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  searchCriteria: {
                    status: "COMPLETED",
                    hasResults: true,
                    condition: args?.condition,
                    intervention: args?.intervention,
                    completedAfter: args?.completedAfter,
                  },
                  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:438-467 (registration)
    Tool definition for 'get_studies_with_results' in the list of available tools.
      name: "get_studies_with_results",
      description:
        "Find completed clinical trials that have published results",
      inputSchema: {
        type: "object",
        properties: {
          condition: {
            type: "string",
            description: "Medical condition to filter by",
          },
          intervention: {
            type: "string",
            description: "Treatment or intervention to filter by",
          },
          completedAfter: {
            type: "string",
            description:
              "Find studies completed after this date (YYYY-MM-DD)",
            pattern: "^\\d{4}-\\d{2}-\\d{2}$",
          },
          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 the full burden of behavioral disclosure. It mentions that the tool finds 'completed clinical trials that have published results,' which implies read-only behavior and a focus on finalized data, but it doesn't disclose details like rate limits, authentication needs, pagination behavior, or what 'published results' entails (e.g., format, availability). This is a significant gap for a tool with no annotation coverage.

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 that front-loads the core purpose ('Find completed clinical trials that have published results') with zero waste. It's appropriately sized for the tool's complexity, making it easy to understand quickly without unnecessary elaboration.

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

Completeness3/5

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

Given the tool's moderate complexity (4 parameters, no output schema, no annotations), the description is minimally adequate. It clearly states the purpose but lacks details on behavioral traits (e.g., pagination, error handling) and output format. With no output schema, the description should ideally hint at return values, but it doesn't, leaving gaps in completeness for effective agent use.

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 schema description coverage is 100%, with clear descriptions for all four parameters (e.g., 'Medical condition to filter by,' 'Find studies completed after this date (YYYY-MM-DD)'). The description doesn't add any parameter-specific semantics beyond what the schema provides, such as explaining how filters combine or default behaviors. Baseline score of 3 is appropriate since the schema does the heavy lifting.

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 clearly states the tool's purpose with specific verbs ('Find') and resources ('completed clinical trials that have published results'). It distinguishes from siblings like 'get_recruiting_studies' (which finds ongoing trials) and 'get_study_details' (which provides details on a specific study) by focusing on completed trials with published results.

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

Usage Guidelines3/5

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

The description implies usage by specifying 'completed clinical trials that have published results,' suggesting it's for finding finalized studies with available outcomes. However, it doesn't explicitly state when to use this tool versus alternatives like 'search_by_condition' or 'get_study_details,' nor does it mention prerequisites or exclusions, leaving some ambiguity.

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