Skip to main content
Glama

get_mechanism_of_action

Retrieve detailed mechanism of action and target interaction data for a specific compound using its ChEMBL ID. Essential for understanding compound-target relationships in drug discovery.

Instructions

Get mechanism of action and target interaction data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chembl_idYesChEMBL compound ID

Implementation Reference

  • src/index.ts:784-785 (registration)
    Registration of the 'get_mechanism_of_action' tool in the CallToolRequestSchema switch statement, dispatching to the handler method.
    case 'get_mechanism_of_action': return await this.handleGetMechanismOfAction(args);
  • Tool 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'], },
  • The handler function that implements the core logic of the 'get_mechanism_of_action' tool. It validates input, queries the ChEMBL /mechanism.json API endpoint with the compound's ChEMBL ID, 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'}` ); } }
  • Helper validation function used by the handler to validate the input arguments for ChEMBL ID.
    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 );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Augmented-Nature/ChEMBL-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server