Convert a structure file
convertConvert a structure between formats: cdxml, cdx, mol, molV3, sdf, rxn, rxnV3, smiles, inchi, inchikey, cml, mrv, json (mol = V2000 molfile, molV3 = V3000, json = Lone Pair drawing). Reads ChemDraw CDXML and CDX. notes says what the target format cannot keep (for example dative bonds in a V2000 molfile). Refused, with the reason, instead of drawn wrongly: SMILES that cannot be read, aromatic rings that cannot alternate single and double bonds, and atoms with too many bonds (unless as_written).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"to": "<to>"
},
"name": "convert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | The format to write. | |
| name | No | Set to true when `input` is a compound name (e.g. "aspirin") rather than a structure. The name is sent to PubChem to find the structure; this is the only network call the server makes. Default false. | |
| input | No | The structure as text: SMILES, reaction SMILES (reactants>agents>products), InChI, a molfile, RXN, SD file, CDXML, CML or Marvin text, or a Lone Pair drawing (the JSON from an earlier result, or the SVG text of an earlier figure). | |
| as_written | No | Draw atoms that have too many bonds instead of refusing the structure. Default false. |