predict_solubility
Predict aqueous solubility and permeability properties for chemical compounds using ChEMBL IDs or SMILES strings to assess bioavailability and drug-likeness.
Instructions
Predict aqueous solubility and permeability properties
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chembl_id | No | ChEMBL compound ID | |
| smiles | No | SMILES string (alternative to ChEMBL ID) |
Implementation Reference
- src/index.ts:1584-1674 (handler)The handler function for the 'predict_solubility' tool. Fetches molecule data from ChEMBL API using chembl_id, extracts properties like alogp, psa, etc., applies simple rules to predict solubility class and permeability, and returns formatted JSON response.private async handlePredictSolubility(args: any) { if (!args || (!args.chembl_id && !args.smiles)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid solubility prediction arguments'); } try { let molecule; if (args.chembl_id) { const response = await this.apiClient.get(`/molecule/${args.chembl_id}.json`); molecule = response.data; } else { return { content: [ { type: 'text', text: JSON.stringify({ message: 'SMILES-based solubility prediction requires ChEMBL ID', smiles: args.smiles, }, null, 2), }, ], }; } const props = molecule.molecule_properties || {}; // Predict solubility based on molecular properties const logp = props.alogp || 0; const psa = props.psa || 0; const mw = props.full_mwt || props.molecular_weight || 0; const hbd = props.hbd || 0; const hba = props.hba || 0; // Simple solubility prediction model let solubilityClass = 'Moderate'; let permeability = 'Moderate'; if (logp < 0 && psa > 100) { solubilityClass = 'High'; permeability = 'Low'; } else if (logp > 5 || psa < 40) { solubilityClass = 'Low'; permeability = 'High'; } else if (logp > 3 && psa < 70) { solubilityClass = 'Low-Moderate'; permeability = 'High'; } else if (logp < 2 && psa > 80) { solubilityClass = 'Moderate-High'; permeability = 'Low-Moderate'; } const solubilityPrediction = { chembl_id: molecule.molecule_chembl_id, aqueous_solubility: { predicted_class: solubilityClass, logp: logp, psa: psa, factors: { lipophilicity: logp > 3 ? 'High (reduces solubility)' : 'Moderate', polar_surface_area: psa > 100 ? 'High (increases solubility)' : 'Moderate', hydrogen_bonding: `${hbd} donors, ${hba} acceptors`, }, }, permeability: { predicted_class: permeability, assessment: this.assessPermeability(props), }, molecular_properties: { molecular_weight: mw, alogp: logp, psa: psa, hbd: hbd, hba: hba, }, }; return { content: [ { type: 'text', text: JSON.stringify(solubilityPrediction, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to predict solubility: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
- src/index.ts:661-670 (schema)Input schema definition for the predict_solubility tool, allowing optional chembl_id or smiles.name: 'predict_solubility', description: 'Predict aqueous solubility and permeability 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:792-792 (registration)Registration of the predict_solubility handler in the CallToolRequestSchema switch statement.return await this.handlePredictSolubility(args);
- src/index.ts:1676-1686 (helper)Helper function used by the handler to assess membrane permeability based on PSA and logP.private assessPermeability(props: any): string { const psa = props.psa || 0; const logp = props.alogp || 0; if (psa < 90 && logp > 0 && logp < 5) { return 'Good membrane permeability predicted'; } else if (psa > 140 || logp < -1) { return 'Poor membrane permeability predicted'; } return 'Moderate membrane permeability predicted'; }