search_studies
Find clinical trials by condition, intervention, location, phase, status, and eligibility criteria to identify relevant research studies.
Instructions
Search for clinical trials with various filters
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_studies"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | General search term (condition, intervention, etc.) | |
| condition | No | Medical condition or disease | |
| intervention | No | Treatment, drug, or intervention | |
| location | No | Geographic location (city, state, country) | |
| phase | No | Study phase (PHASE1, PHASE2, PHASE3, PHASE4, NA) | |
| status | No | Recruitment status | |
| sex | No | Sex eligibility | |
| age | No | Age group | |
| pageSize | No | Number of results to return (default 10, max 100) |
Implementation Reference
- build/index.js:660-721 (handler)Implementation of the search_studies tool handler.
async handleSearchStudies(args) { const params = { format: "json", pageSize: args?.pageSize || 10, }; // Build query parameters based on arguments if (args?.query) { params["query.term"] = args.query; } if (args?.condition) { params["query.cond"] = args.condition; } if (args?.intervention) { params["query.intr"] = args.intervention; } if (args?.location) { params["query.locn"] = args.location; } if (args?.phase) { params["filter.phase"] = args.phase; } if (args?.status) { params["filter.overallStatus"] = args.status; } if (args?.sex) { params["filter.sex"] = args.sex; } if (args?.age) { params["filter.stdAge"] = args.age; } try { const response = await this.axiosInstance.get("/studies", { params }); const studies = response.data.studies || []; const results = studies.map((study) => this.formatStudySummary(study)); return { content: [ { type: "text", text: JSON.stringify({ 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:48-105 (registration)Definition and registration of the search_studies tool in the ListToolsRequest handler.
{ name: "search_studies", description: "Search for clinical trials with various filters", inputSchema: { type: "object", properties: { query: { type: "string", description: "General search term (condition, intervention, etc.)", }, condition: { type: "string", description: "Medical condition or disease", }, intervention: { type: "string", description: "Treatment, drug, or intervention", }, location: { type: "string", description: "Geographic location (city, state, country)", }, phase: { type: "string", description: "Study phase (PHASE1, PHASE2, PHASE3, PHASE4, NA)", enum: ["PHASE1", "PHASE2", "PHASE3", "PHASE4", "NA"], }, status: { type: "string", description: "Recruitment status", enum: [ "RECRUITING", "NOT_YET_RECRUITING", "COMPLETED", "TERMINATED", "SUSPENDED", "WITHDRAWN", ], }, sex: { type: "string", description: "Sex eligibility", enum: ["ALL", "FEMALE", "MALE"], }, age: { type: "string", description: "Age group", enum: ["CHILD", "ADULT", "OLDER_ADULT"], }, pageSize: { type: "number", description: "Number of results to return (default 10, max 100)", minimum: 1, maximum: 100, }, }, }, },