Skip to main content
Glama

get_target_compounds

Retrieve compounds tested against a specific target from the ChEMBL database, filtered by activity type or result limit, for streamlined research insights.

Instructions

Get compounds tested against a specific target

Input Schema

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

Implementation Reference

  • The main handler function `handleGetTargetCompounds` that implements the tool logic. Validates input arguments, queries the ChEMBL `/activity.json` endpoint filtered by `target_chembl_id` (optionally `activity_type`), extracts unique `molecule_chembl_id`s from activities, and returns a formatted JSON summary with counts and truncated lists.
    // Placeholder implementations for remaining tools 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)
    Registration of the `get_target_compounds` tool in the `tools` array returned by `ListToolsRequestSchema` handler. Includes name, description, and input schema definition.
    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)
    Dispatch/registration in the `CallToolRequestSchema` switch statement that routes calls to `get_target_compounds` to the `handleGetTargetCompounds` handler.
    case 'get_target_compounds': return await this.handleGetTargetCompounds(args);
  • Input schema definition for the `get_target_compounds` tool, specifying required `target_chembl_id` and optional `activity_type` and `limit` parameters with types and constraints.
    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'], },

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