get_assay_info
Retrieve detailed assay information from ChEMBL database using the assay ID to access experimental data and metadata.
Instructions
Get detailed information for a specific assay by ChEMBL assay ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chembl_id | Yes | ChEMBL assay ID (e.g., CHEMBL1217643) |
Implementation Reference
- src/index.ts:1113-1124 (handler)The core handler function that implements the logic for the 'get_assay_info' tool. It validates the input chembl_id and fetches detailed assay information from the ChEMBL API.private async handleGetAssayInfo(args: any) { if (!isValidChemblIdArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments'); } try { const response = await this.apiClient.get(`/assay/${args.chembl_id}.json`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; } catch (error) { throw new McpError(ErrorCode.InternalError, `Failed to get assay info: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
- src/index.ts:536-545 (schema)The tool's metadata including name, description, and input schema definition, provided in response to ListToolsRequest.name: 'get_assay_info', description: 'Get detailed information for a specific assay by ChEMBL assay ID', inputSchema: { type: 'object', properties: { chembl_id: { type: 'string', description: 'ChEMBL assay ID (e.g., CHEMBL1217643)' }, }, required: ['chembl_id'], }, },
- src/index.ts:769-770 (registration)Dispatches calls to the 'get_assay_info' tool handler within the CallToolRequestSchema request handler.case 'get_assay_info': return await this.handleGetAssayInfo(args);
- src/index.ts:90-99 (helper)Type guard and validation function for chembl_id arguments, used by get_assay_info and similar tools.const isValidChemblIdArgs = ( args: any ): args is { chembl_id: string } => { return ( typeof args === 'object' && args !== null && typeof args.chembl_id === 'string' && args.chembl_id.length > 0 ); };
- src/index.ts:309-330 (registration)Related resource handler for assay data (chembl://assay/{id}), which performs identical API fetch as the tool.// Handle assay info requests const assayMatch = uri.match(/^chembl:\/\/assay\/([A-Z0-9]+)$/); if (assayMatch) { const chemblId = assayMatch[1]; try { const response = await this.apiClient.get(`/assay/${chemblId}.json`); return { contents: [ { uri: request.params.uri, mimeType: 'application/json', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to fetch assay ${chemblId}: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }