Skip to main content
Glama
Augmented-Nature

ChEMBL MCP Server

calculate_descriptors

Compute molecular descriptors and physicochemical properties for chemical compounds using ChEMBL IDs or SMILES strings to analyze molecular characteristics.

Instructions

Calculate molecular descriptors and physicochemical properties

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chembl_idNoChEMBL compound ID
smilesNoSMILES string (alternative to ChEMBL ID)

Implementation Reference

  • The main handler function for the 'calculate_descriptors' tool. It fetches molecule data from ChEMBL API if chembl_id is provided, extracts and organizes various molecular descriptors and physicochemical properties from the molecule_properties and molecule_structures, and returns them in a structured JSON format. For SMILES input only, it returns an error message indicating ChEMBL ID is required.
    private async handleCalculateDescriptors(args: any) {
      if (!args || (!args.chembl_id && !args.smiles)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid descriptor calculation arguments');
      }
    
      try {
        let molecule;
        if (args.chembl_id) {
          const response = await this.apiClient.get(`/molecule/${args.chembl_id}.json`);
          molecule = response.data;
        } else {
          // For SMILES input, we can only provide limited info
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  message: 'SMILES-based descriptor calculation requires ChEMBL ID',
                  smiles: args.smiles,
                }, null, 2),
              },
            ],
          };
        }
    
        const props = molecule.molecule_properties || {};
        const structures = molecule.molecule_structures || {};
    
        const descriptors = {
          chembl_id: molecule.molecule_chembl_id,
          basic_properties: {
            molecular_weight: props.full_mwt || props.molecular_weight,
            exact_mass: props.full_mwt,
            molecular_formula: props.molecular_formula,
          },
          lipophilicity: {
            alogp: props.alogp,
            logp: props.alogp,
          },
          hydrogen_bonding: {
            hbd: props.hbd,
            hba: props.hba,
          },
          polar_surface_area: {
            psa: props.psa,
            tpsa: props.psa,
          },
          complexity: {
            rotatable_bonds: props.rtb,
            aromatic_rings: props.aromatic_rings,
            heavy_atoms: props.heavy_atoms,
            num_atoms: props.num_atoms,
          },
          drug_likeness_metrics: {
            ro5_violations: props.num_ro5_violations,
            ro3_pass: props.ro3_pass,
            cx_logp: props.cx_logp,
            cx_logd: props.cx_logd,
          },
          structures: {
            smiles: structures.canonical_smiles,
            inchi: structures.standard_inchi,
            inchi_key: structures.standard_inchi_key,
          },
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(descriptors, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to calculate descriptors: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • The input schema definition for the 'calculate_descriptors' tool, registered in the ListToolsRequestSchema handler. It accepts optional chembl_id or smiles strings.
    name: 'calculate_descriptors',
    description: 'Calculate molecular descriptors and physicochemical properties',
    inputSchema: {
      type: 'object',
      properties: {
        chembl_id: { type: 'string', description: 'ChEMBL compound ID' },
        smiles: { type: 'string', description: 'SMILES string (alternative to ChEMBL ID)' },
      },
      required: [],
    },
  • src/index.ts:791-792 (registration)
    The registration of the tool handler in the CallToolRequestSchema switch statement within setupToolHandlers method.
    case 'predict_solubility':
      return await this.handlePredictSolubility(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does ('calculate') but doesn't describe how it behaves—e.g., whether it's a read-only operation, if it requires specific inputs, what the output format is, or any limitations like rate limits or computational intensity. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Calculate molecular descriptors and physicochemical properties.' It's front-loaded with the core action and resource, with no unnecessary words or redundancy. Every part of the sentence contributes directly to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a calculation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what descriptors or properties are calculated, the format of results, or any behavioral traits like error handling or performance. For a tool that likely returns complex data, more context is needed to be fully helpful to an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with both parameters ('chembl_id' and 'smiles') clearly documented. The description doesn't add any parameter-specific information beyond what the schema provides, such as explaining the relationship between the two parameters or usage examples. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Calculate molecular descriptors and physicochemical properties' specifies both the verb ('calculate') and the resource ('molecular descriptors and physicochemical properties'). It distinguishes from some siblings like 'get_compound_info' or 'search_compounds' by focusing on calculation rather than retrieval or search, though it doesn't explicitly differentiate from similar tools like 'analyze_admet_properties' or 'predict_solubility'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or comparisons to sibling tools like 'analyze_admet_properties' or 'assess_drug_likeness', which might overlap in functionality. Without such guidance, users must infer usage from the tool name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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