Lone Pair

Draws chemical structures and reactions as journal-style figures; converts and analyses molecules.

Should I use this

Quality & Safety

A
Description quality
100%
Schema completeness
94%
Naming quality
91%
Poisoning risk
100%
Permission match
100%
Protocol compliance
100%

Based on automated analysis of tool definitions and protocol compliance.

Context Cost

~9,390Tokens (tool definitions)
~5.6 KBTypical response size
Significant attention impact (7.34% of 128k context)

This is the approximate number of tokens consumed each time the server's tools are loaded into a model's context. Higher counts reduce the attention available for other tasks.

Install

One-Click Install

Add this to your `claude_desktop_config.json` file:

{
  "mcpServers": {
    "lonepair": {
      "url": "https://mcp.lonepair.app/mcp"
    }
  }
}

Remote endpoints

https://mcp.lonepair.app/mcpstreamable-http

What it can do

Tool inventory

Tools (13)

🟢 Read-only🟡 Write🔴 Delete⚪ Unknown
🟢draw(input, name, as_written, format, style, ...)

Draw a chemical structure or reaction as a publication-style figure (ChemDraw-like skeletal formula) with the Lone Pair editor's renderer. Give SMILES, reaction SMILES, InChI, a molfile, a ChemDraw file, or a compound name with name=true. 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`). The result carries `drawing` (Lone Pair JSON to pass to edit_drawing or back in as `input`) and `notes` (anything changed on reading or lost in the format). The SVG and PNG hold the drawing inside them, so they reopen for editing at lonepair.app. Not for a scheme built from separate reactant and product lists (use render_reaction), for changing an earlier figure (use edit_drawing), for numbers only (use analyze), or for molecules placed over a picture (use compose_figure).

Input Schema

{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "description": "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)."
    },
    "name": {
      "type": "boolean",
      "description": "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. Short text that is valid SMILES (such as \"CO\") is read as SMILES, with a note, and not sent. Default false."
    },
    "as_written": {
      "type": "boolean",
      "description": "Draw atoms that have too many bonds instead of refusing the structure. Default false."
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "svg",
        "pdf",
        "eps"
      ],
      "description": "png (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`)."
    },
    "style": {
      "type": "string",
      "enum": [
        "acs",
        "rsc",
        "nature",
        "slides"
      ],
      "description": "Journal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides."
    },
    "dpi": {
      "type": "number",
      "description": "PNG resolution, 300 by default; 600 for print."
    },
    "opaque": {
      "type": "boolean",
      "description": "White background instead of transparent (SVG, PNG). Default false."
    },
    "embed": {
      "type": "boolean",
      "description": "For a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-inchikey, and px sizes; the result's `embed` gives its box, the drawn bond length and each atom's position (atom n = the n-th atom of the input), and how to place it. Place it whole and scale it uniformly; never redraw or retouch it. Default false."
    },
    "color": {
      "type": "string",
      "description": "black (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture."
    },
    "highlight": {
      "type": "array",
      "description": "Highlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ \"atoms\": [1, 2, 3], \"color\": \"#ffe066\" }]. Atoms are numbered from 1 in input order; bonds between listed atoms are highlighted too, and `bonds` adds others. SVG and PNG only.",
      "items": {
        "type": "object",
        "properties": {
          "atoms": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Atom numbers."
          },
          "bonds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "description": "Bonds as pairs of atom numbers."
          },
          "color": {
            "type": "string",
            "description": "#rrggbb; default #ffe066 (yellow)."
          }
        }
      }
    },
    "outline_text": {
      "type": "boolean",
      "description": "SVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false."
    },
    "embed_id": {
      "type": "string",
      "description": "With embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey."
    }
  }
}
🟢render_reaction(reactants, products, above, below, as_written, ...)

Draw a reaction scheme from its parts: reactants joined by plus signs, an arrow with optional text above and below, then products. Each structure is SMILES, InChI or a molfile, not a name: use draw with name=true to get a SMILES first. 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`). The result carries `drawing` (Lone Pair JSON to pass to edit_drawing or back in as `input`) and `notes` (anything changed on reading or lost in the format). Not for a reaction already written as reaction SMILES (use draw).

Input Schema

{
  "type": "object",
  "properties": {
    "reactants": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Structures left of the arrow."
    },
    "products": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Structures right of the arrow."
    },
    "above": {
      "type": "string",
      "description": "Text above the arrow: reagents or catalyst. Digits after letters become subscripts (H2SO4)."
    },
    "below": {
      "type": "string",
      "description": "Text below the arrow: solvent, temperature, time."
    },
    "as_written": {
      "type": "boolean",
      "description": "Draw atoms that have too many bonds instead of refusing the structure. Default false."
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "svg",
        "pdf",
        "eps"
      ],
      "description": "png (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`)."
    },
    "style": {
      "type": "string",
      "enum": [
        "acs",
        "rsc",
        "nature",
        "slides"
      ],
      "description": "Journal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides."
    },
    "dpi": {
      "type": "number",
      "description": "PNG resolution, 300 by default; 600 for print."
    },
    "opaque": {
      "type": "boolean",
      "description": "White background instead of transparent (SVG, PNG). Default false."
    },
    "embed": {
      "type": "boolean",
      "description": "For a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-inchikey, and px sizes; the result's `embed` gives its box, the drawn bond length and each atom's position (atom n = the n-th atom of the input), and how to place it. Place it whole and scale it uniformly; never redraw or retouch it. Default false."
    },
    "color": {
      "type": "string",
      "description": "black (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture."
    },
    "highlight": {
      "type": "array",
      "description": "Highlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ \"atoms\": [1, 2, 3], \"color\": \"#ffe066\" }]. Atoms are numbered from 1 in input order; bonds between listed atoms are highlighted too, and `bonds` adds others. SVG and PNG only.",
      "items": {
        "type": "object",
        "properties": {
          "atoms": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Atom numbers."
          },
          "bonds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "description": "Bonds as pairs of atom numbers."
          },
          "color": {
            "type": "string",
            "description": "#rrggbb; default #ffe066 (yellow)."
          }
        }
      }
    },
    "outline_text": {
      "type": "boolean",
      "description": "SVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false."
    },
    "embed_id": {
      "type": "string",
      "description": "With embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey."
    }
  },
  "required": [
    "reactants",
    "products"
  ]
}
🟢render_scheme(compounds, steps, retro, wrap, format, ...)

Draw a synthesis of several steps as one scheme, in journal style: numbered compounds (the numbers bold under each structure), an arrow per step with reagents above, conditions below and the yield under them, a compound shared by two steps drawn once, and rows that wrap. Give compounds as {"1": SMILES, "2": SMILES} and steps as [{"from": ["1"], "to": ["2"], "above": "PCC", "below": "CH2Cl2, rt", "yield": "85%"}]. retro: true draws it as a retrosynthesis from the target, with retrosynthetic arrows. `notes` checks the scheme without refusing it: a step that starts from a compound a later step makes, and each step's atom balance, naming the small by-product (H2O, HCl, CO2, MeOH…) that would balance it. Not for one step (use render_reaction) or for arrow-pushing (use render_mechanism). The result carries `drawing` (Lone Pair JSON to pass to edit_drawing or back in as `input`) and `notes` (anything changed on reading or lost in the format).

Input Schema

{
  "type": "object",
  "properties": {
    "compounds": {
      "type": "object",
      "description": "Compound number → SMILES, e.g. {\"1\": \"CCO\", \"2\": \"CC=O\"}. Numbers are short: 1, 2a, 3′."
    },
    "steps": {
      "type": "array",
      "maxItems": 12,
      "description": "The steps in order.",
      "items": {
        "type": "object",
        "properties": {
          "from": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Compound numbers it starts from."
          },
          "to": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Compound numbers it gives."
          },
          "above": {
            "type": "string",
            "description": "Reagents, above the arrow."
          },
          "below": {
            "type": "string",
            "description": "Solvent, temperature, time, below the arrow."
          },
          "yield": {
            "type": "string",
            "description": "The yield, under the arrow, e.g. \"85%\"."
          },
          "arrow": {
            "type": "string",
            "enum": [
              "reaction",
              "equilibrium",
              "dashed",
              "nogo"
            ],
            "description": "Arrow type (default reaction)."
          }
        },
        "required": [
          "from",
          "to"
        ]
      }
    },
    "retro": {
      "type": "boolean",
      "description": "Draw it as a retrosynthesis from the target. Default false."
    },
    "wrap": {
      "type": "integer",
      "description": "Steps per row before it wraps. Default 4."
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "svg",
        "pdf",
        "eps"
      ],
      "description": "png (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`)."
    },
    "style": {
      "type": "string",
      "enum": [
        "acs",
        "rsc",
        "nature",
        "slides"
      ],
      "description": "Journal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides."
    },
    "dpi": {
      "type": "number",
      "description": "PNG resolution, 300 by default; 600 for print."
    },
    "opaque": {
      "type": "boolean",
      "description": "White background instead of transparent (SVG, PNG). Default false."
    },
    "embed": {
      "type": "boolean",
      "description": "For a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-inchikey, and px sizes; the result's `embed` gives its box, the drawn bond length and each atom's position (atom n = the n-th atom of the input), and how to place it. Place it whole and scale it uniformly; never redraw or retouch it. Default false."
    },
    "color": {
      "type": "string",
      "description": "black (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture."
    },
    "highlight": {
      "type": "array",
      "description": "Highlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ \"atoms\": [1, 2, 3], \"color\": \"#ffe066\" }]. Atoms are numbered from 1 in input order; bonds between listed atoms are highlighted too, and `bonds` adds others. SVG and PNG only.",
      "items": {
        "type": "object",
        "properties": {
          "atoms": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Atom numbers."
          },
          "bonds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "description": "Bonds as pairs of atom numbers."
          },
          "color": {
            "type": "string",
            "description": "#rrggbb; default #ffe066 (yellow)."
          }
        }
      }
    },
    "outline_text": {
      "type": "boolean",
      "description": "SVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false."
    },
    "embed_id": {
      "type": "string",
      "description": "With embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey."
    }
  },
  "required": [
    "compounds",
    "steps"
  ]
}
🟢render_mechanism(structures, arrows, show_lone_pairs, format, style, ...)

Draw one step of a reaction mechanism with curved (arrow-pushing) arrows. Give the structures as SMILES with atom-map numbers on the atoms the arrows touch, e.g. ["[CH3:1][Br:2]", "[OH-:3]"], and each arrow's `from` and `to` by those numbers: {"atom": n}, {"bond": [n, m]}, {"lone_pair": n}, {"charge": n}, or {"between": [n, m]} for a bond that forms. An arrow from a lone pair starts at the drawn pair (the atom's lone pairs are shown if the drawing had none); a curly arrow moves two electrons, a fishhook one. The curves bow away from the structures. `notes` warns about chemistry that looks wrong (an arrow from an atom with nothing to give, electrons sent to a carbon with a full octet when no bond breaks), and a map number that is not in the structures is refused. Arrows are ordinary curved arrows the editor can move. Not for a whole multi-step scheme (use render_reaction for each step's reactants and products) or for guessing the mechanism: give the arrows. The result carries `drawing` (Lone Pair JSON to pass to edit_drawing or back in as `input`) and `notes` (anything changed on reading or lost in the format).

Input Schema

{
  "type": "object",
  "properties": {
    "structures": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 6,
      "description": "SMILES of each species, left to right, with atom-map numbers ([CH3:1]) on the atoms the arrows name."
    },
    "arrows": {
      "type": "array",
      "maxItems": 40,
      "description": "The curved arrows, in order.",
      "items": {
        "type": "object",
        "properties": {
          "from": {
            "type": "object",
            "description": "{atom|lone_pair|charge: n} or {bond: [n, m]}."
          },
          "to": {
            "type": "object",
            "description": "{atom|charge: n}, {bond: [n, m]} or {between: [n, m]}."
          },
          "type": {
            "type": "string",
            "enum": [
              "curly",
              "fishhook"
            ],
            "description": "curly (default): two electrons; fishhook: one."
          }
        },
        "required": [
          "from",
          "to"
        ]
      }
    },
    "show_lone_pairs": {
      "type": "string",
      "enum": [
        "arrow_sources",
        "all",
        "none"
      ],
      "description": "Which lone pairs to draw: on the atoms arrows start from (default), on every heteroatom, or none."
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "svg",
        "pdf",
        "eps"
      ],
      "description": "png (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`)."
    },
    "style": {
      "type": "string",
      "enum": [
        "acs",
        "rsc",
        "nature",
        "slides"
      ],
      "description": "Journal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides."
    },
    "dpi": {
      "type": "number",
      "description": "PNG resolution, 300 by default; 600 for print."
    },
    "opaque": {
      "type": "boolean",
      "description": "White background instead of transparent (SVG, PNG). Default false."
    },
    "embed": {
      "type": "boolean",
      "description": "For a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-inchikey, and px sizes; the result's `embed` gives its box, the drawn bond length and each atom's position (atom n = the n-th atom of the input), and how to place it. Place it whole and scale it uniformly; never redraw or retouch it. Default false."
    },
    "color": {
      "type": "string",
      "description": "black (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture."
    },
    "highlight": {
      "type": "array",
      "description": "Highlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ \"atoms\": [1, 2, 3], \"color\": \"#ffe066\" }]. Atoms are numbered from 1 in input order; bonds between listed atoms are highlighted too, and `bonds` adds others. SVG and PNG only.",
      "items": {
        "type": "object",
        "properties": {
          "atoms": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Atom numbers."
          },
          "bonds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "description": "Bonds as pairs of atom numbers."
          },
          "color": {
            "type": "string",
            "description": "#rrggbb; default #ffe066 (yellow)."
          }
        }
      }
    },
    "outline_text": {
      "type": "boolean",
      "description": "SVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false."
    },
    "embed_id": {
      "type": "string",
      "description": "With embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey."
    }
  },
  "required": [
    "structures",
    "arrows"
  ]
}
🟢convert(input, name, as_written, to)

Convert 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`). Not for images (use draw with format svg or png).

Input Schema

{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "description": "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)."
    },
    "name": {
      "type": "boolean",
      "description": "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. Short text that is valid SMILES (such as \"CO\") is read as SMILES, with a note, and not sent. Default false."
    },
    "as_written": {
      "type": "boolean",
      "description": "Draw atoms that have too many bonds instead of refusing the structure. Default false."
    },
    "to": {
      "type": "string",
      "enum": [
        "cdxml",
        "cdx",
        "mol",
        "molV3",
        "sdf",
        "rxn",
        "rxnV3",
        "smiles",
        "inchi",
        "inchikey",
        "cml",
        "mrv",
        "json"
      ],
      "description": "The format to write."
    }
  },
  "required": [
    "to"
  ]
}
🟢analyze(input, name, as_written)

For each structure in the input: molecular formula, molecular weight, exact (monoisotopic) mass, elemental analysis, SMILES, InChI and InChIKey. For a reaction: each structure's role and whether atoms and charge balance (each drawn structure counted once). Calculated from the structure, not looked up. Not for pKa (use estimate_pka), bond dissociation energies (use estimate_bde), NMR (use predict_nmr) or mass spectra (use mass_spectrum).

Input Schema

{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "description": "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)."
    },
    "name": {
      "type": "boolean",
      "description": "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. Short text that is valid SMILES (such as \"CO\") is read as SMILES, with a note, and not sent. Default false."
    },
    "as_written": {
      "type": "boolean",
      "description": "Draw atoms that have too many bonds instead of refusing the structure. Default false."
    }
  }
}
🟢edit_drawing(drawing, add, add_is_name, caption, ops, ...)

Change a figure Lone Pair made earlier and get the new figure. `ops` changes atoms and bonds: add, change element or charge, delete, bond, move, recolour. Atoms are named by their id in `drawing` (or {map: n} for an atom-map number from SMILES such as [CH3:1]). The operations are applied all or nothing: if one fails or leaves an atom over its valence, nothing changes and the error names the operation. The result's `changes` lists what was added, changed and removed, with the formula before and after. Also: add a structure beside it, change the journal style, or put a caption under it. Give the earlier result's `drawing`. Everything else in the drawing stays as it was. Not for drawing something new (use draw). The result carries `drawing` (Lone Pair JSON to pass to edit_drawing or back in as `input`) and `notes` (anything changed on reading or lost in the format).

Input Schema

{
  "type": "object",
  "properties": {
    "drawing": {
      "type": "object",
      "description": "The `drawing` object from an earlier result."
    },
    "add": {
      "type": "string",
      "description": "A structure to add to the right of the drawing (SMILES, InChI, molfile)."
    },
    "add_is_name": {
      "type": "boolean",
      "description": "True when `add` is a compound name to look up at PubChem. Default false."
    },
    "caption": {
      "type": "string",
      "description": "Text to put under the drawing."
    },
    "ops": {
      "type": "array",
      "maxItems": 200,
      "description": "Operations, in order. add_atom {el, bond_to, order}; set_atom {atom, el, charge, lp, iso, map}; delete {atoms, bonds}; add_bond {a, b, order, stereo}; set_bond {bond or a+b, order, stereo, kind}; move {atoms, dx, dy}; add_group {smiles, at} (a substituent, its first atom joining: \"[N+](=O)[O-]\"); add_structure {smiles, at: right|below}; add_text {text}; set_color {atoms, bonds, color #rrggbb}. Examples: lonepair.app/agents#edit",
      "items": {
        "type": "object",
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "add_atom",
              "set_atom",
              "delete",
              "add_bond",
              "set_bond",
              "move",
              "add_group",
              "add_structure",
              "add_text",
              "add_arrow",
              "set_color"
            ]
          }
        },
        "required": [
          "op"
        ]
      }
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "svg",
        "pdf",
        "eps"
      ],
      "description": "png (default; returned as an image), svg (returned as text), pdf or eps (returned as base64 in `data_base64`)."
    },
    "style": {
      "type": "string",
      "enum": [
        "acs",
        "rsc",
        "nature",
        "slides"
      ],
      "description": "Journal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides."
    },
    "dpi": {
      "type": "number",
      "description": "PNG resolution, 300 by default; 600 for print."
    },
    "opaque": {
      "type": "boolean",
      "description": "White background instead of transparent (SVG, PNG). Default false."
    },
    "embed": {
      "type": "boolean",
      "description": "For a structure that goes into a larger figure (an SVG or HTML figure you build, or a picture an image model made): format svg or png only. The SVG gets its own id, data-smiles, data-formula and data-inchikey, and px sizes; the result's `embed` gives its box, the drawn bond length and each atom's position (atom n = the n-th atom of the input), and how to place it. Place it whole and scale it uniformly; never redraw or retouch it. Default false."
    },
    "color": {
      "type": "string",
      "description": "black (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture."
    },
    "highlight": {
      "type": "array",
      "description": "Highlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ \"atoms\": [1, 2, 3], \"color\": \"#ffe066\" }]. Atoms are numbered from 1 in input order; bonds between listed atoms are highlighted too, and `bonds` adds others. SVG and PNG only.",
      "items": {
        "type": "object",
        "properties": {
          "atoms": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Atom numbers."
          },
          "bonds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "description": "Bonds as pairs of atom numbers."
          },
          "color": {
            "type": "string",
            "description": "#rrggbb; default #ffe066 (yellow)."
          }
        }
      }
    },
    "outline_text": {
      "type": "boolean",
      "description": "SVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false."
    },
    "embed_id": {
      "type": "string",
      "description": "With embed: the id for this structure in your figure (letters, digits, - and _). Give one when the same structure appears twice. Default: lp- and the start of its InChIKey."
    }
  }
}
🟢estimate_pka(input, name, as_written, atoms)

Estimate the pKa of each acidic site (the X–H, in water and in DMSO where tabulated) and the pKaH of each basic site of a structure, most acidic first, with the basis of each value. These are the same rule-based estimates as the Lone Pair editor's pKa tool: tabulated values (Evans–Ripin, Bordwell/Reich, Williams) with Hammett and inductive corrections, usually within ±1 unit for simple sites. Call this instead of searching the web for an estimate, and say the numbers are estimates. Atoms are numbered from 1 in the order the input writes them (SMILES order); `atoms` limits the answer to those atoms and also shows weak C–H acids, which are left out by default. Symmetric sites are listed once with a count. Not for drawing (use draw), formula and mass (use analyze) or bond energies (use estimate_bde).

Input Schema

{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "description": "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)."
    },
    "name": {
      "type": "boolean",
      "description": "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. Short text that is valid SMILES (such as \"CO\") is read as SMILES, with a note, and not sent. Default false."
    },
    "as_written": {
      "type": "boolean",
      "description": "Draw atoms that have too many bonds instead of refusing the structure. Default false."
    },
    "atoms": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Only these atoms (numbered from 1 in input order). Default: every site."
    }
  }
}
🟢estimate_bde(input, name, as_written, atoms, bonds)

Estimate homolytic bond dissociation energies (gas phase, 298 K) in kcal/mol and kJ/mol, weakest bond first, with the basis of each value. By default every X–H bond and every acyclic single bond between heavy atoms. These are the same estimates as the Lone Pair editor's BDE tool: Blanksby & Ellison reference values with additive radical-stabilization terms, and the Sanderson/Reusch R–X compilation; expect about ±2–3 kcal/mol. Where no specific value exists, an average bond enthalpy is given and marked. Call this instead of searching the web for an estimate, and say the numbers are estimates. Atoms are numbered from 1 in the order the input writes them (SMILES order). Not for pKa (use estimate_pka) or reaction energies.

Input Schema

{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "description": "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)."
    },
    "name": {
      "type": "boolean",
      "description": "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. Short text that is valid SMILES (such as \"CO\") is read as SMILES, with a note, and not sent. Default false."
    },
    "as_written": {
      "type": "boolean",
      "description": "Draw atoms that have too many bonds instead of refusing the structure. Default false."
    },
    "atoms": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "The X–H bonds at these atoms (numbered from 1 in input order)."
    },
    "bonds": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "integer"
        }
      },
      "description": "Bonds between heavy atoms, each a pair of atom numbers, e.g. [[1, 2]]."
    }
  }
}
🟢predict_nmr(input, name, as_written)

Estimate the 1H and 13C NMR spectrum of a structure in CDCl3: each peak's shift in ppm, the number of protons, multiplicity and J in Hz, and the atoms it comes from (numbered from 1 in input order). These are the same additive-increment estimates as the Lone Pair editor's NMR tool (Shoolery/Pretsch, Pascual–Meier–Simon, Grant–Paul), not a spectral database: expect roughly ±0.3 ppm for 1H and ±5 ppm for 13C. A peak from an environment with little reference data is marked confidence: low. Call this instead of searching the web for an estimate, and say the numbers are estimates. Not for measured spectra (cite the literature), pKa (use estimate_pka) or masses (use mass_spectrum or analyze).

Input Schema

{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "description": "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)."
    },
    "name": {
      "type": "boolean",
      "description": "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. Short text that is valid SMILES (such as \"CO\") is read as SMILES, with a note, and not sent. Default false."
    },
    "as_written": {
      "type": "boolean",
      "description": "Draw atoms that have too many bonds instead of refusing the structure. Default false."
    }
  }
}
🟢mass_spectrum(input, name, as_written, mode)

For each structure: monoisotopic mass, m/z of the common adducts ([M+H]+, [M+Na]+, [M−H]− and more), the isotope pattern, and a rule-based estimate of MS/MS fragments of [M+H]+ (mode neg: [M−H]−) with each fragment's formula and how it forms. Masses and the isotope pattern are calculated exactly; the fragments are an estimate, not validated against measured spectra, so present them as fragments to look for. Not for NMR (use predict_nmr) or a formula and molecular weight alone (use analyze).

Input Schema

{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "description": "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)."
    },
    "name": {
      "type": "boolean",
      "description": "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. Short text that is valid SMILES (such as \"CO\") is read as SMILES, with a note, and not sent. Default false."
    },
    "as_written": {
      "type": "boolean",
      "description": "Draw atoms that have too many bonds instead of refusing the structure. Default false."
    },
    "mode": {
      "type": "string",
      "enum": [
        "pos",
        "neg"
      ],
      "description": "MS/MS of [M+H]+ (pos, default) or [M−H]− (neg)."
    }
  }
}
🟢verify_figure(figure, expect)

Check a finished figure (SVG, or HTML with inline SVG) that holds structures Lone Pair drew with embed: true. Each Lone Pair molecule is found by the drawing data inside it and rebuilt from it, then checked: its label (data-inchikey) names that structure; its lines and atom labels are the ones Lone Pair draws for it, drawn the same way (nothing redrawn, relabelled, recoloured, hidden or moved, whether by an attribute, an inline style or a rule in the figure's style sheets); nothing around it hides, clips, stretches, skews or mirrors it (SVG groups, HTML wrappers and their CSS included); and, with `expect`, every structure the figure should show is there, matched by InChIKey (a match on the skeleton only is reported as different stereo or charge). Also gives each molecule's bond length on the page, so all can be scaled to one. Structures drawn any other way, including inside raster images, cannot be checked and are reported as such; nor can anything else drawn on top of a molecule, style sheets in other files, or what a script does. Call it on every figure before showing it, and fix what it reports: draw the molecule again and place the new SVG unchanged. Not for drawing (use draw with embed: true) or for checking a single structure's formula (use analyze).

Input Schema

{
  "type": "object",
  "properties": {
    "figure": {
      "type": "string",
      "description": "The whole figure as text: an SVG, or HTML with the SVG inside."
    },
    "expect": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The structures the figure should show, each as SMILES or InChI. Default: none, and only the molecules themselves are checked."
    }
  }
}
🟢compose_figure(width, height, molecules, color, outline_text, ...)

Put Lone Pair structures over a picture, such as a background an image model made with empty space for each molecule, so that no structure is drawn by the image model. Give the picture's size in pixels and, for each molecule, its structure and a box (x, y, width, height in the picture's pixels). Each molecule is drawn by Lone Pair, fitted to its box at one bond length for the whole figure, centred, and laid over the picture as the top layer on a white plate (plate: false for none). SVG (default): the figure the size of the picture, showing the picture by background_href; it can be checked again with verify_figure. PNG: a transparent overlay the size of the picture, to lay over it. The result gives each molecule's place, its bond length and its atoms' positions in the picture's pixels (for arrows and labels), and the check verify_figure makes. 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`). Not for a figure without a picture (use draw with embed: true and the figure template).

Input Schema

{
  "type": "object",
  "properties": {
    "width": {
      "type": "integer",
      "description": "The picture's width in pixels."
    },
    "height": {
      "type": "integer",
      "description": "The picture's height in pixels."
    },
    "molecules": {
      "type": "array",
      "description": "The molecules to place, each over the empty space left for it.",
      "items": {
        "type": "object",
        "properties": {
          "structure": {
            "type": "string",
            "description": "SMILES, InChI or a molfile; a compound name with name: true."
          },
          "name": {
            "type": "boolean",
            "description": "True when structure is a compound name to look up at PubChem."
          },
          "x": {
            "type": "number",
            "description": "Left of its box, in the picture's pixels."
          },
          "y": {
            "type": "number",
            "description": "Top of its box."
          },
          "width": {
            "type": "number",
            "description": "Width of its box."
          },
          "height": {
            "type": "number",
            "description": "Height of its box."
          },
          "embed_id": {
            "type": "string",
            "description": "Its id in the figure; needed when the same structure is placed twice."
          },
          "highlight": {
            "type": "array",
            "description": "Highlight parts of the structure with a coloured band under them, e.g. the atoms that react: [{ \"atoms\": [1, 2, 3], \"color\": \"#ffe066\" }]. Atoms are numbered from 1 in input order; bonds between listed atoms are highlighted too, and `bonds` adds others. SVG and PNG only.",
            "items": {
              "type": "object",
              "properties": {
                "atoms": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "description": "Atom numbers."
                },
                "bonds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "description": "Bonds as pairs of atom numbers."
                },
                "color": {
                  "type": "string",
                  "description": "#rrggbb; default #ffe066 (yellow)."
                }
              }
            }
          }
        },
        "required": [
          "structure",
          "x",
          "y",
          "width",
          "height"
        ]
      }
    },
    "color": {
      "type": "string",
      "description": "black (default); cpk to colour heteroatoms (N blue, O red, S yellow, halogens green); or one colour as #rrggbb for every line and label, such as #ffffff over a dark picture."
    },
    "outline_text": {
      "type": "boolean",
      "description": "SVG: draw atom labels and text as outlines instead of text, so the figure looks the same in any program, with or without the fonts. Default false."
    },
    "bond_length": {
      "type": "number",
      "description": "Bond length in pixels for every molecule. Default: the largest that fits every box."
    },
    "plate": {
      "type": "boolean",
      "description": "A white rounded plate behind each molecule so it reads over the picture. Default true."
    },
    "background_href": {
      "type": "string",
      "description": "The picture's file name or URL, written into the SVG so that it shows the picture (it is not fetched)."
    },
    "format": {
      "type": "string",
      "enum": [
        "svg",
        "png"
      ],
      "description": "svg (default) or png."
    },
    "style": {
      "type": "string",
      "enum": [
        "acs",
        "rsc",
        "nature",
        "slides"
      ],
      "description": "Journal style. acs = ACS Document 1996 (default), rsc = RSC, nature = Nature Reviews, slides = heavier lines for slides."
    }
  },
  "required": [
    "molecules"
  ]
}

Community

Rate this Server

Evidence

Recent observations

verifiedversion not recorded13 tools