Skip to main content
Glama
BACH-AI-Tools

Clinical Trials MCP Server

get_study_timeline

Retrieve detailed timeline and milestone information for clinical trials, filtering by condition, sponsor, phase, and timeline type to track study progress.

Instructions

Get detailed timeline and milestone information for studies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionNoCondition to filter studies
sponsorNoSponsor to filter studies
phaseNoStudy phase filter
timelineTypeNoType of timeline analysisCURRENT
pageSizeNoNumber of results to return (default 10, max 50)

Implementation Reference

  • Handler function for 'get_study_timeline' tool.
    async handleGetStudyTimeline(args) {
        const params = {
            format: "json",
            pageSize: args?.pageSize || 10,
        };
        if (args?.condition) {
            params["query.cond"] = args.condition;
        }
        if (args?.sponsor) {
            params["query.spons"] = args.sponsor;
        }
        if (args?.phase) {
            params["filter.phase"] = args.phase;
        }
        // Apply timeline type filtering
        const timelineType = args?.timelineType || "CURRENT";
        switch (timelineType) {
            case "CURRENT":
                params["filter.overallStatus"] =
                    "RECRUITING,NOT_YET_RECRUITING,ACTIVE_NOT_RECRUITING";
                break;
            case "COMPLETED":
                params["filter.overallStatus"] = "COMPLETED";
                break;
            case "UPCOMING":
                params["filter.overallStatus"] = "NOT_YET_RECRUITING";
                const futureDate = new Date();
                futureDate.setDate(futureDate.getDate() + 30);
                params["filter.studyStartDateFrom"] = futureDate
                    .toISOString()
                    .split("T")[0];
                break;
        }
        try {
            const response = await this.axiosInstance.get("/studies", { params });
            const studies = response.data.studies || [];
            const results = studies.map((study) => ({
                ...this.formatStudySummary(study),
                timeline: {
                    startDate: study.protocolSection.statusModule.startDateStruct?.date,
                    primaryCompletionDate: study.protocolSection.statusModule.primaryCompletionDateStruct
                        ?.date,
                    status: study.protocolSection.statusModule.overallStatus,
                    daysFromStart: study.protocolSection.statusModule.startDateStruct
                        ?.date
                        ? Math.floor((new Date().getTime() -
                            new Date(study.protocolSection.statusModule.startDateStruct.date).getTime()) /
                            (1000 * 60 * 60 * 24))
                        : null,
                },
            }));
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify({
                            searchCriteria: {
                                condition: args?.condition,
                                sponsor: args?.sponsor,
                                phase: args?.phase,
                                timelineType,
                            },
                            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;
        }
    }
  • build/index.js:536-568 (registration)
    Registration of 'get_study_timeline' tool in ListTools request handler.
        name: "get_study_timeline",
        description: "Get detailed timeline and milestone information for studies",
        inputSchema: {
            type: "object",
            properties: {
                condition: {
                    type: "string",
                    description: "Condition to filter studies",
                },
                sponsor: {
                    type: "string",
                    description: "Sponsor to filter studies",
                },
                phase: {
                    type: "string",
                    description: "Study phase filter",
                    enum: ["PHASE1", "PHASE2", "PHASE3", "PHASE4", "NA"],
                },
                timelineType: {
                    type: "string",
                    description: "Type of timeline analysis",
                    enum: ["CURRENT", "COMPLETED", "UPCOMING"],
                    default: "CURRENT",
                },
                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 the full burden of behavioral disclosure. It mentions 'detailed timeline and milestone information' but doesn't specify what that includes (e.g., dates, statuses, events), whether it's read-only (implied by 'Get'), any rate limits, authentication needs, or pagination behavior beyond the 'pageSize' parameter in the schema.

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 without unnecessary words. Every part of it ('Get detailed timeline and milestone information for studies') contributes directly to understanding the tool's function, 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.

Completeness3/5

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

Given the lack of annotations and output schema, the description is minimally adequate for a read operation but leaves gaps. It doesn't explain the return format (e.g., what 'detailed timeline' entails), error conditions, or how it integrates with sibling tools. For a tool with 5 parameters and no structured output documentation, more context would be helpful.

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 description adds no parameter-specific information beyond what's already in the input schema, which has 100% coverage with clear descriptions and enums for parameters like 'phase' and 'timelineType'. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate with additional context or examples.

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 with a specific verb ('Get') and resource ('detailed timeline and milestone information for studies'), making it easy to understand what it does. However, it doesn't explicitly differentiate from siblings like 'get_study_details' or 'search_by_date_range', which might also provide timeline-related information.

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 many sibling tools focused on studies (e.g., 'get_study_details', 'search_by_date_range'), there's no indication of whether this tool is for comprehensive timeline analysis, filtered views, or how it differs from other study-related queries.

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