Skip to main content
Glama

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
NameRequiredDescriptionDefault
chembl_idYesChEMBL compound ID

Implementation Reference

  • 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);
  • 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'], }, },
  • 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 ); };

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