search_by_primary_outcome
Find clinical trials by specifying primary outcome measures or endpoints, with optional filters for condition and study phase.
Instructions
Search clinical trials by primary outcome measures or endpoints
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| outcome | Yes | Primary outcome or endpoint to search for | |
| condition | No | Optional condition filter | |
| phase | No | Study phase filter | |
| pageSize | No | Number of results to return (default 10, max 100) |
Implementation Reference
- src/index.ts:1920-1986 (handler)Handler for search_by_primary_outcome tool.
private async handleSearchByPrimaryOutcome(args: any) { if (!args?.outcome) { throw new McpError( ErrorCode.InvalidParams, "Outcome parameter is required" ); } const params: any = { format: "json", pageSize: args?.pageSize || 10, "query.outc": args.outcome, }; if (args?.condition) { params["query.cond"] = args.condition; } if (args?.phase) { params["filter.phase"] = args.phase; } try { const response: AxiosResponse<StudySearchResponse> = 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( { searchCriteria: { primaryOutcome: args.outcome, condition: args?.condition, phase: args?.phase, }, 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:560-590 (schema)Schema definition for search_by_primary_outcome tool.
name: "search_by_primary_outcome", description: "Search clinical trials by primary outcome measures or endpoints", inputSchema: { type: "object", properties: { outcome: { type: "string", description: "Primary outcome or endpoint to search for", minLength: 3, }, condition: { type: "string", description: "Optional condition filter", }, phase: { type: "string", description: "Study phase filter", enum: ["PHASE1", "PHASE2", "PHASE3", "PHASE4", "NA"], }, pageSize: { type: "number", description: "Number of results to return (default 10, max 100)", minimum: 1, maximum: 100, }, }, required: ["outcome"], }, }, - src/index.ts:758-761 (registration)Registration/routing for search_by_primary_outcome tool.
case "search_by_primary_outcome": return await this.handleSearchByPrimaryOutcome( request.params.arguments );