Skip to main content
Glama
Augmented-Nature

ChEMBL MCP Server

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'],
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. The description mentions comparing data but doesn't explain what the comparison entails (e.g., statistical analysis, side-by-side display, correlation metrics), what format the output takes, whether there are rate limits, or what happens with invalid inputs. For a tool with 3 parameters and no annotations, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point. There's no wasted language or unnecessary elaboration. It's appropriately sized for what it communicates, though what it communicates is somewhat limited in scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what the comparison output looks like, how results are structured, what happens when target_chembl_id is omitted, or what 'activity_type' encompasses. For a comparison tool with multiple inputs and no structured output documentation, more context is needed about the tool's behavior and results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds minimal value beyond the schema - it mentions 'compounds or targets' which aligns with the molecule_chembl_ids and target_chembl_id parameters, but doesn't provide additional context about parameter relationships or usage. With complete schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: comparing bioactivity data across compounds or targets. It specifies the action ('compare') and resource ('bioactivity data'), but doesn't explicitly differentiate from sibling tools like 'search_activities' or 'get_dose_response' which might involve similar concepts. The description is specific enough to understand what the tool does without being tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools that deal with activities, compounds, and targets (e.g., 'search_activities', 'get_target_compounds', 'search_by_activity_type'), but the description doesn't explain what makes 'compare_activities' distinct or when it's the appropriate choice. No context about prerequisites or exclusions is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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