Skip to main content
Glama

compare_activities

Compare bioactivity data across multiple compounds or targets to analyze pharmacological profiles and identify patterns in drug discovery research.

Instructions

Compare bioactivity data across multiple compounds or targets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
molecule_chembl_idsYesArray of ChEMBL compound IDs (2-10)
target_chembl_idNoChEMBL target ID for comparison
activity_typeNoActivity type for comparison

Implementation Reference

  • The handler function that executes the tool. It validates the input arguments, fetches bioactivity data from ChEMBL API for each provided molecule_chembl_id (filtered by optional target_chembl_id and activity_type), compiles comparison results including activity counts and samples, and returns a formatted JSON response.
    private async handleCompareActivities(args: any) { if (!args || !Array.isArray(args.molecule_chembl_ids) || args.molecule_chembl_ids.length < 2) { throw new McpError(ErrorCode.InvalidParams, 'Invalid activity comparison arguments'); } try { const comparisonResults = []; for (const chemblId of args.molecule_chembl_ids.slice(0, 10)) { const params: any = { molecule_chembl_id: chemblId, limit: 50, }; if (args.target_chembl_id) { params.target_chembl_id = args.target_chembl_id; } if (args.activity_type) { params.standard_type = args.activity_type; } try { const response = await this.apiClient.get('/activity.json', { params }); const activities = response.data.activities || []; comparisonResults.push({ molecule_chembl_id: chemblId, activity_count: activities.length, activities: activities.slice(0, 20), }); } catch (error) { comparisonResults.push({ molecule_chembl_id: chemblId, error: error instanceof Error ? error.message : 'Unknown error', }); } } return { content: [ { type: 'text', text: JSON.stringify({ comparison_results: comparisonResults, target_filter: args.target_chembl_id, activity_type_filter: args.activity_type, }, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to compare activities: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • src/index.ts:574-585 (registration)
    Registration of the 'compare_activities' tool in the ListTools response, including name, description, and input schema definition.
    name: 'compare_activities', description: 'Compare bioactivity data across multiple compounds or targets', inputSchema: { type: 'object', properties: { molecule_chembl_ids: { type: 'array', items: { type: 'string' }, description: 'Array of ChEMBL compound IDs (2-10)', minItems: 2, maxItems: 10 }, target_chembl_id: { type: 'string', description: 'ChEMBL target ID for comparison' }, activity_type: { type: 'string', description: 'Activity type for comparison' }, }, required: ['molecule_chembl_ids'], }, },
  • src/index.ts:776-777 (registration)
    Dispatcher case in the CallToolRequestSchema handler that routes calls to the compare_activities handler function.
    return await this.handleCompareActivities(args); // Drug Development & Clinical Data
  • Input schema definition for the compare_activities tool, specifying parameters like molecule_chembl_ids (required array), target_chembl_id, and activity_type.
    inputSchema: { type: 'object', properties: { molecule_chembl_ids: { type: 'array', items: { type: 'string' }, description: 'Array of ChEMBL compound IDs (2-10)', minItems: 2, maxItems: 10 }, target_chembl_id: { type: 'string', description: 'ChEMBL target ID for comparison' }, activity_type: { type: 'string', description: 'Activity type for comparison' }, }, required: ['molecule_chembl_ids'], },

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