Install
openclaw skills install intern-pubchem-name-conversionConvert molecules between IUPAC, SMILES, and molecular formula using PubChem as the source of truth. Use this whenever the user asks to convert, normalize, o...
openclaw skills install intern-pubchem-name-conversionConvert one molecular representation into all three fields:
smilesiupacformulaUse this skill when the user asks to:
Do not use this skill for:
Expect one input value and one type:
input_type: iupac or smilesinput_value: raw stringIf the user gives only one string without type:
=, #, [, ], @) as smilesiupac/name queryAlways query PubChem first. Do not answer from memory when tools are available.
ENCODED=$(python3 -c 'import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1], safe=""))' "$INPUT_VALUE")
input_type == iupac:
https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/{ENCODED}/property/SMILES,IUPACName,MolecularFormula/JSONinput_type == smiles:
https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/smiles/{ENCODED}/property/SMILES,IUPACName,MolecularFormula/JSONsmiles primary endpoint is non-200, retry once with:https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastidentity/smiles/{ENCODED}/property/SMILES,IUPACName,MolecularFormula/JSON.../compound/name/{ENCODED}/cids/JSON.../compound/smiles/{ENCODED}/cids/JSON.../compound/cid/{CID}/property/SMILES,IUPACName,MolecularFormula/JSONPropertyTable.Properties[0] and map:smiles <- SMILES (fallback ConnectivitySMILES)iupac <- IUPACNameformula <- MolecularFormulaReturn JSON only (no markdown fences, no extra prose):
{
"smiles": "...",
"iupac": "...",
"formula": "..."
}
If all attempts fail, still return the same schema with empty strings:
{
"smiles": "",
"iupac": "",
"formula": ""
}