get_compound_info
Retrieve comprehensive details about a compound by providing its ChEMBL ID, such as CHEMBL59, using this tool on the ChEMBL MCP Server.
Instructions
Get detailed information for a specific compound by ChEMBL ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chembl_id | Yes | ChEMBL compound ID (e.g., CHEMBL59) |
Implementation Reference
- src/index.ts:855-876 (handler)The handler function that validates the input chembl_id and fetches detailed compound information from the ChEMBL API endpoint, returning the JSON response.private async handleGetCompoundInfo(args: any) { if (!isValidChemblIdArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid ChEMBL ID arguments'); } try { const response = await this.apiClient.get(`/molecule/${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 compound info: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
- src/index.ts:410-419 (registration)Tool registration in the ListTools response, defining the name, description, and input schema for get_compound_info.name: 'get_compound_info', description: 'Get detailed information for a specific compound by ChEMBL ID', inputSchema: { type: 'object', properties: { chembl_id: { type: 'string', description: 'ChEMBL compound ID (e.g., CHEMBL59)' }, }, required: ['chembl_id'], }, },
- src/index.ts:413-418 (schema)Input schema definition specifying the required 'chembl_id' parameter as a string.type: 'object', properties: { chembl_id: { type: 'string', description: 'ChEMBL compound ID (e.g., CHEMBL59)' }, }, required: ['chembl_id'], },
- src/index.ts:747-749 (registration)Dispatch registration in the CallToolRequestSchema switch statement that routes calls to the handler.case 'get_compound_info': return await this.handleGetCompoundInfo(args); case 'search_by_inchi':
- src/index.ts:90-99 (helper)Helper function for input validation, checking if arguments contain a valid non-empty chembl_id string. Used by get_compound_info handler.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 ); };