search_activities
Find bioactivity measurements and assay results for compounds, targets, or assays using ChEMBL IDs and activity types.
Instructions
Search bioactivity measurements and assay results
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_activities"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_chembl_id | No | ChEMBL target ID filter | |
| assay_chembl_id | No | ChEMBL assay ID filter | |
| molecule_chembl_id | No | ChEMBL compound ID filter | |
| activity_type | No | Activity type (e.g., IC50, Ki, EC50) | |
| limit | No | Number of results to return (1-1000, default: 25) |
Implementation Reference
- src/index.ts:1099-1111 (handler)The core handler function that implements the search_activities tool logic. It constructs query parameters from input arguments and fetches bioactivity data from the ChEMBL API /activity.json endpoint.
private async handleSearchActivities(args: any) { try { const params: any = { limit: args.limit || 25 }; if (args.target_chembl_id) params.target_chembl_id = args.target_chembl_id; if (args.molecule_chembl_id) params.molecule_chembl_id = args.molecule_chembl_id; if (args.activity_type) params.standard_type = args.activity_type; const response = await this.apiClient.get('/activity.json', { params }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; } catch (error) { throw new McpError(ErrorCode.InternalError, `Failed to search activities: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/index.ts:521-534 (schema)The input schema definition for the search_activities tool, specifying parameters like target_chembl_id, assay_chembl_id, molecule_chembl_id, activity_type, and limit.
name: 'search_activities', description: 'Search bioactivity measurements and assay results', inputSchema: { type: 'object', properties: { target_chembl_id: { type: 'string', description: 'ChEMBL target ID filter' }, assay_chembl_id: { type: 'string', description: 'ChEMBL assay ID filter' }, molecule_chembl_id: { type: 'string', description: 'ChEMBL compound ID filter' }, activity_type: { type: 'string', description: 'Activity type (e.g., IC50, Ki, EC50)' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: [], }, }, - src/index.ts:767-768 (registration)Registration of the search_activities tool in the CallToolRequestSchema handler switch statement, routing calls to the handleSearchActivities method.
case 'search_activities': return await this.handleSearchActivities(args); - src/index.ts:126-139 (helper)Input validation helper function for search_activities tool arguments, ensuring valid types and at least one filter is provided.
const isValidActivitySearchArgs = ( args: any ): args is { target_chembl_id?: string; assay_chembl_id?: string; molecule_chembl_id?: string; activity_type?: string; limit?: number } => { return ( typeof args === 'object' && args !== null && (args.target_chembl_id === undefined || typeof args.target_chembl_id === 'string') && (args.assay_chembl_id === undefined || typeof args.assay_chembl_id === 'string') && (args.molecule_chembl_id === undefined || typeof args.molecule_chembl_id === 'string') && (args.activity_type === undefined || typeof args.activity_type === 'string') && (args.limit === undefined || (typeof args.limit === 'number' && args.limit > 0 && args.limit <= 1000)) && (args.target_chembl_id !== undefined || args.assay_chembl_id !== undefined || args.molecule_chembl_id !== undefined) ); };