get_drug_info
Retrieve drug development status and clinical trial data for a specific compound using its ChEMBL ID.
Instructions
Get drug development status and clinical trial information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chembl_id | Yes | ChEMBL compound ID |
Implementation Reference
- src/index.ts:1312-1352 (handler)Main handler function for 'get_drug_info' tool. Validates input, fetches molecule details and drug indications from ChEMBL API, returns formatted JSON response.private async handleGetDrugInfo(args: any) { if (!isValidChemblIdArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid drug info arguments'); } try { // Get molecule information const moleculeResponse = await this.apiClient.get(`/molecule/${args.chembl_id}.json`); const molecule = moleculeResponse.data; // Get drug indication data if available let indications = []; try { const indicationResponse = await this.apiClient.get('/drug_indication.json', { params: { molecule_chembl_id: args.chembl_id, limit: 50 }, }); indications = indicationResponse.data.drug_indications || []; } catch (e) { // Indications may not be available for all compounds } return { content: [ { type: 'text', text: JSON.stringify({ chembl_id: args.chembl_id, molecule_info: molecule, development_phase: molecule.max_phase, indications: indications, }, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to get drug info: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
- src/index.ts:778-781 (registration)Registration of 'get_drug_info' tool handler in the CallToolRequestSchema switch statement.case 'search_drugs': return await this.handleSearchDrugs(args); case 'get_drug_info': return await this.handleGetDrugInfo(args);
- src/index.ts:602-610 (schema)Tool schema definition and registration in ListToolsRequestSchema response, including input schema requiring 'chembl_id'.name: 'get_drug_info', description: 'Get drug development status and clinical trial information', inputSchema: { type: 'object', properties: { chembl_id: { type: 'string', description: 'ChEMBL compound ID' }, }, required: ['chembl_id'], },
- src/index.ts:90-99 (helper)Helper validation function isValidChemblIdArgs used to validate input arguments for get_drug_info and similar tools.const isValidChemblIdArgs = ( args: any ): args is { chembl_id: string } => { return ( typeof args === 'object' && args !== null && typeof args.chembl_id === 'string' && args.chembl_id.length > 0 ); };