Skip to main content
Glama
BACH-AI-Tools

Clinical Trials MCP Server

get_study_details

Retrieve comprehensive clinical trial information using the NCT ID to access study details, eligibility criteria, and outcomes from ClinicalTrials.gov.

Instructions

Get detailed information about a specific clinical trial

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nctIdYesNCT ID of the study (e.g., NCT00000419)

Implementation Reference

  • The handler function for 'get_study_details' tool, which fetches study details from the ClinicalTrials.gov API using an NCT ID.
    async handleGetStudyDetails(args) {
        if (!args?.nctId || !/^NCT\d{8}$/.test(args.nctId)) {
            throw new McpError(ErrorCode.InvalidParams, "Valid NCT ID is required (format: NCT########)");
        }
        try {
            // Use the same endpoint as search but filter by NCT ID
            const response = await this.axiosInstance.get("/studies", {
                params: {
                    format: "json",
                    "query.term": args.nctId,
                    "filter.ids": args.nctId,
                    pageSize: 1,
                },
            });
            if (!response.data.studies || response.data.studies.length === 0) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `No study found with NCT ID: ${args.nctId}`,
                        },
                    ],
                    isError: true,
                };
            }
            const study = response.data.studies[0];
            const detailedInfo = this.formatDetailedStudy(study);
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(detailedInfo, null, 2),
                    },
                ],
            };
        }
        catch (error) {
            if (axios.isAxiosError(error)) {
                if (error.response?.status === 404) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Study not found: ${args.nctId}`,
                            },
                        ],
                        isError: true,
                    };
                }
                return {
                    content: [
                        {
                            type: "text",
                            text: `Clinical Trials API error: ${error.response?.data?.message || error.message}`,
                        },
                    ],
                    isError: true,
                };
            }
            throw error;
        }
    }
  • build/index.js:106-120 (registration)
    The registration of the 'get_study_details' tool in the MCP server tool list.
    {
        name: "get_study_details",
        description: "Get detailed information about a specific clinical trial",
        inputSchema: {
            type: "object",
            properties: {
                nctId: {
                    type: "string",
                    description: "NCT ID of the study (e.g., NCT00000419)",
                    pattern: "^NCT\\d{8}$",
                },
            },
            required: ["nctId"],
        },
    },
  • build/index.js:615-616 (registration)
    Tool routing logic to call 'handleGetStudyDetails' when 'get_study_details' is requested.
    case "get_study_details":
        return await this.handleGetStudyDetails(request.params.arguments);
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 states the tool retrieves information but does not specify if it's read-only, requires authentication, has rate limits, or describes the return format. This is inadequate 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 directly states the tool's purpose without any redundant or unnecessary information. It is appropriately sized and front-loaded.

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 does not explain what 'detailed information' includes, the response format, or behavioral traits like error handling. For a tool with rich sibling context and no structured support, this leaves significant gaps.

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%, with the parameter 'nctId' fully documented in the schema. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, so it meets the baseline for high schema coverage.

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 verb ('Get') and resource ('detailed information about a specific clinical trial'), making the purpose unambiguous. However, it does not explicitly differentiate from siblings like 'get_study_timeline' or 'get_trial_statistics', which might also retrieve study details, so it lacks 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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, exclusions, or compare to sibling tools like 'get_studies_with_results' or 'search_by_condition', leaving the agent with no usage context.

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