search_drug_indications
Find drugs and their therapeutic uses by searching disease indications and filtering by drug type to identify treatment options.
Instructions
Search for therapeutic indications and disease areas
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indication | Yes | Disease or indication search term | |
| drug_type | No | Drug type filter (e.g., Small molecule, Antibody) | |
| limit | No | Number of results to return (1-1000, default: 25) |
Implementation Reference
- src/index.ts:1354-1381 (handler)The handler function that implements the core logic for the 'search_drug_indications' tool. It validates input, queries the ChEMBL API /drug_indication.json endpoint with the indication search term, and returns the JSON results.
private async handleSearchDrugIndications(args: any) { if (!args || typeof args.indication !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid drug indications arguments'); } try { const response = await this.apiClient.get('/drug_indication.json', { params: { q: args.indication, limit: args.limit || 25, }, }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to search drug indications: ${error instanceof Error ? error.message : 'Unknown error'}` ); } } - src/index.ts:613-623 (schema)The input schema definition for the 'search_drug_indications' tool, specifying parameters like indication (required), drug_type, and limit.
name: 'search_drug_indications', description: 'Search for therapeutic indications and disease areas', inputSchema: { type: 'object', properties: { indication: { type: 'string', description: 'Disease or indication search term' }, drug_type: { type: 'string', description: 'Drug type filter (e.g., Small molecule, Antibody)' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['indication'], }, - src/index.ts:782-783 (registration)Registration of the tool handler in the main CallToolRequestSchema switch statement, mapping the tool name to its handler function.
case 'search_drug_indications': return await this.handleSearchDrugIndications(args); - src/index.ts:612-624 (registration)Tool registration in the ListToolsRequestSchema response, defining the tool's name, description, and input schema.
{ name: 'search_drug_indications', description: 'Search for therapeutic indications and disease areas', inputSchema: { type: 'object', properties: { indication: { type: 'string', description: 'Disease or indication search term' }, drug_type: { type: 'string', description: 'Drug type filter (e.g., Small molecule, Antibody)' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['indication'], }, },