get_mechanism_of_action
Retrieve mechanism of action and target interaction data for ChEMBL compounds to understand how drugs work at the molecular level.
Instructions
Get mechanism of action and target interaction data
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chembl_id | Yes | ChEMBL compound ID |
Implementation Reference
- src/index.ts:1383-1410 (handler)The handler function that implements the 'get_mechanism_of_action' tool. It validates the input ChEMBL ID, queries the ChEMBL /mechanism.json endpoint, and returns the mechanism of action data as JSON.private async handleGetMechanismOfAction(args: any) { if (!isValidChemblIdArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid mechanism of action arguments'); } try { const response = await this.apiClient.get('/mechanism.json', { params: { molecule_chembl_id: args.chembl_id, limit: 50, }, }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to get mechanism of action: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
- src/index.ts:784-785 (registration)Registration and dispatch of the 'get_mechanism_of_action' tool in the CallToolRequestSchema switch statement.case 'get_mechanism_of_action': return await this.handleGetMechanismOfAction(args);
- src/index.ts:626-635 (schema)Tool schema definition including name, description, and input schema for 'get_mechanism_of_action' in the ListToolsRequestSchema response.name: 'get_mechanism_of_action', description: 'Get mechanism of action and target interaction data', inputSchema: { type: 'object', properties: { chembl_id: { type: 'string', description: 'ChEMBL compound ID' }, }, required: ['chembl_id'], }, },
- src/index.ts:90-99 (helper)Helper function for validating ChEMBL ID arguments, used in the get_mechanism_of_action handler.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 ); };