Skip to main content
Glama
Augmented-Nature

ChEMBL MCP Server

get_drug_info

Retrieve drug development status and clinical trial data for a specific compound using its ChEMBL ID.

Instructions

Get drug development status and clinical trial information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chembl_idYesChEMBL compound ID

Implementation Reference

  • Main handler function for 'get_drug_info' tool. Validates input, fetches molecule details and drug indications from ChEMBL API, returns formatted JSON response.
    private async handleGetDrugInfo(args: any) {
      if (!isValidChemblIdArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid drug info arguments');
      }
    
      try {
        // Get molecule information
        const moleculeResponse = await this.apiClient.get(`/molecule/${args.chembl_id}.json`);
        const molecule = moleculeResponse.data;
    
        // Get drug indication data if available
        let indications = [];
        try {
          const indicationResponse = await this.apiClient.get('/drug_indication.json', {
            params: { molecule_chembl_id: args.chembl_id, limit: 50 },
          });
          indications = indicationResponse.data.drug_indications || [];
        } catch (e) {
          // Indications may not be available for all compounds
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                chembl_id: args.chembl_id,
                molecule_info: molecule,
                development_phase: molecule.max_phase,
                indications: indications,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to get drug info: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • src/index.ts:778-781 (registration)
    Registration of 'get_drug_info' tool handler in the CallToolRequestSchema switch statement.
    case 'search_drugs':
      return await this.handleSearchDrugs(args);
    case 'get_drug_info':
      return await this.handleGetDrugInfo(args);
  • Tool schema definition and registration in ListToolsRequestSchema response, including input schema requiring 'chembl_id'.
    name: 'get_drug_info',
    description: 'Get drug development status and clinical trial information',
    inputSchema: {
      type: 'object',
      properties: {
        chembl_id: { type: 'string', description: 'ChEMBL compound ID' },
      },
      required: ['chembl_id'],
    },
  • Helper validation function isValidChemblIdArgs used to validate input arguments for get_drug_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
      );
    };

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