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
| Name | Required | Description | Default |
|---|---|---|---|
| condition | No | Medical condition to filter by | |
| intervention | No | Treatment or intervention to filter by | |
| completedAfter | No | Find studies completed after this date (YYYY-MM-DD) | |
| pageSize | No | Number of results to return (default 10, max 100) |
Implementation Reference
- src/index.ts:1551-1622 (handler)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, }, }, }, },