Skip to main content
Glama
Augmented-Nature

ChEMBL MCP Server

get_target_compounds

Retrieve compounds tested against a specific biological target from ChEMBL database, filtering by activity type and limiting results.

Instructions

Get compounds tested against a specific target

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_chembl_idYesChEMBL target ID
activity_typeNoActivity type filter (e.g., IC50, Ki, Kd)
limitNoNumber of results to return (1-1000, default: 25)

Implementation Reference

  • Implements the core logic for the 'get_target_compounds' tool. Queries the ChEMBL API /activity endpoint with target_chembl_id filter, processes activities to extract unique molecule_chembl_ids, and returns a summary with compound counts and samples.
    private async handleGetTargetCompounds(args: any) {
      if (!args || typeof args.target_chembl_id !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid target compounds arguments');
      }
    
      try {
        const params: any = {
          target_chembl_id: args.target_chembl_id,
          limit: args.limit || 25,
        };
    
        if (args.activity_type) {
          params.standard_type = args.activity_type;
        }
    
        const response = await this.apiClient.get('/activity.json', { params });
    
        // Extract unique compounds from activities
        const activities = response.data.activities || [];
        const compoundIds = [...new Set(activities.map((a: any) => a.molecule_chembl_id))];
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                target_chembl_id: args.target_chembl_id,
                total_activities: activities.length,
                unique_compounds: compoundIds.length,
                compound_ids: compoundIds.slice(0, 100),
                activities: activities.slice(0, 50),
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to get target compounds: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • src/index.ts:484-495 (registration)
    Registers the 'get_target_compounds' tool in the ListToolsRequestSchema response, defining its name, description, and input schema.
      name: 'get_target_compounds',
      description: 'Get compounds tested against a specific target',
      inputSchema: {
        type: 'object',
        properties: {
          target_chembl_id: { type: 'string', description: 'ChEMBL target ID' },
          activity_type: { type: 'string', description: 'Activity type filter (e.g., IC50, Ki, Kd)' },
          limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 },
        },
        required: ['target_chembl_id'],
      },
    },
  • src/index.ts:760-761 (registration)
    Dispatches calls to the 'get_target_compounds' tool to its handler function in the CallToolRequestSchema switch statement.
    case 'get_target_compounds':
      return await this.handleGetTargetCompounds(args);
  • Defines the input schema (JSON Schema) for validating parameters to the 'get_target_compounds' tool: requires target_chembl_id, optional activity_type and limit.
    inputSchema: {
      type: 'object',
      properties: {
        target_chembl_id: { type: 'string', description: 'ChEMBL target ID' },
        activity_type: { type: 'string', description: 'Activity type filter (e.g., IC50, Ki, Kd)' },
        limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 },
      },
      required: ['target_chembl_id'],
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't cover critical aspects like rate limits, authentication needs, pagination, error handling, or what the return format looks like (e.g., list of compounds with activity data). This is a significant gap for a tool with no annotation coverage.

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, clear sentence with zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 the tool has no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., compound IDs, activity values, structures) or behavioral traits like performance or constraints. For a data retrieval tool with three parameters, this leaves too many gaps for effective agent use.

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 the schema fully documents all three parameters (target_chembl_id, activity_type, limit). The description doesn't add any parameter-specific details beyond what's in the schema, such as examples for target_chembl_id format or how activity_type filtering works in practice. Baseline 3 is appropriate when the schema does the heavy lifting.

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 with a specific verb ('Get') and resource ('compounds tested against a specific target'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'search_activities' or 'search_by_activity_type' that might also retrieve compound-activity data, which prevents a perfect score.

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. It doesn't mention prerequisites, exclusions, or compare it to siblings like 'search_activities' or 'search_compounds', leaving the agent to infer usage from the name alone.

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