Skip to main content
Glama

generate_molecule

Draw a single compound as a 2D structure from a name or SMILES and export PNG/SVG with structure, properties, and functional groups.

Instructions

Draw one compound as a 2D structure — the default for a single substance.

Writes PNG/SVG files and returns an interactive panel with the structure, properties and functional groups. A bare compound name ("caffeine") also means this tool, and so does a question about why one compound behaves as it does (acidity, solubility) — the answer is in its structure. No ChemDraw required. A Fischer or Haworth projection of a sugar or amino acid, or a drawing with all H atoms, is this tool too: set view to "fischer", "haworth" or "all_h".

Not this tool for: several individual structures (use batch_generate), structural differences (use compare_molecules), a reaction scheme (use generate_reaction), or a data sheet (use lookup_molecule_data).

Pass English or IUPAC names, or SMILES; use label for a localized display name.

Args: name_or_smiles: English/IUPAC compound name or SMILES string. label: Display name shown below the structure (may be localized). formats: Any of "png", "svg", "cdxml" (default: png + svg). Add "cdxml" only when the structure is to be edited in ChemDraw. annotate_stereo: True prints CIP descriptors (R/S, E/Z) at each stereocenter. abbreviate_groups: True draws common substituents as the short labels chemists write by hand (Ph, Bn, OAc, OMe, CO2H, NO2, tBu, Boc, Ts, TMS). The chemistry is unchanged; no hover tooltips in the panel. render_style: "" standard · "compact" thin bonds for small print · "presentation" thick bonds for slides · "grayscale" b/w palette. stereo_variants: True returns every stereoisomer of the open centers (max 3) as a pick list instead of a drawing; only on request. view: "fischer"/"haworth"/"all_h" opens on that drawing, only if the user names it.

Input Schema

NameRequiredDescriptionDefault
viewNo
labelNo
formatsNo
render_styleNo
name_or_smilesYes
annotate_stereoNo
stereo_variantsNo
abbreviate_groupsNo

Output Schema

NameRequiredDescriptionDefault
svgNo
nameNo
typeNomolecule
atomsNo
filesNo
viewsNo
messageNo
viewSvgNo
lipinskiNo
subtitleNo
viewAtomsNo
candidatesNo
cdxml_pathNo
propertiesNo
stereoNoteNo
initialViewNo
viewRequestNo
projectionNoteNo
stereoWarningsNo
functionalGroupsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv0.6.0
    • addedInput schema / properties / stereo_variants
      Added value: +{
      +  "default": false,
      +  "title": "Stereo Variants",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / view
      Added value: +{
      +  "default": "",
      +  "title": "View",
      +  "type": "string"
      +}
    • addedOutput schema / $defs / IsomerCandidate
      Added value: +{
      +  "description": "One structure a family name (\"xylene\", \"Glucose\") can mean.",
      +  "properties": {
      +    "label": {
      +      "title": "Label",
      +      "type": "string"
      +    },
      +    "name": {
      +      "default": "",
      +      "title": "Name",
      +      "type": "string"
      +    },
      +    "smiles": {
      +      "title": "Smiles",
      +      "type": "string"
      +    },
      +    "svg": {
      +      "default": "",
      +      "title": "Svg",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "label",
      +    "smiles"
      +  ],
      +  "title": "IsomerCandidate",
      +  "type": "object"
      +}
    • addedOutput schema / $defs / StereoWarning
      Added value: +{
      +  "description": "Ein Stereoelement, dessen Konfiguration die Eingabe offen lässt.",
      +  "properties": {
      +    "atoms": {
      +      "default": [],
      +      "items": {
      +        "type": "integer"
      +      },
      +      "title": "Atoms",
      +      "type": "array"
      +    },
      +    "kind": {
      +      "title": "Kind",
      +      "type": "string"
      +    },
      +    "label": {
      +      "default": "",
      +      "title": "Label",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "kind"
      +  ],
      +  "title": "StereoWarning",
      +  "type": "object"
      +}
    • addedOutput schema / properties / candidates
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "$ref": "#/$defs/IsomerCandidate"
      +  },
      +  "title": "Candidates",
      +  "type": "array"
      +}
    • addedOutput schema / properties / initialView
      Added value: +{
      +  "default": "",
      +  "title": "Initialview",
      +  "type": "string"
      +}
    • addedOutput schema / properties / message
      Added value: +{
      +  "default": "",
      +  "title": "Message",
      +  "type": "string"
      +}
    • addedOutput schema / properties / projectionNote
      Added value: +{
      +  "default": "",
      +  "title": "Projectionnote",
      +  "type": "string"
      +}
    • addedOutput schema / properties / stereoNote
      Added value: +{
      +  "default": "",
      +  "title": "Stereonote",
      +  "type": "string"
      +}
    • addedOutput schema / properties / stereoWarnings
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "$ref": "#/$defs/StereoWarning"
      +  },
      +  "title": "Stereowarnings",
      +  "type": "array"
      +}
    • addedOutput schema / properties / viewAtoms
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "$ref": "#/$defs/AtomData"
      +  },
      +  "title": "Viewatoms",
      +  "type": "array"
      +}
    • addedOutput schema / properties / viewRequest
      Added value: +{
      +  "additionalProperties": true,
      +  "default": {},
      +  "title": "Viewrequest",
      +  "type": "object"
      +}
    • addedOutput schema / properties / viewSvg
      Added value: +{
      +  "default": "",
      +  "title": "Viewsvg",
      +  "type": "string"
      +}
    • addedOutput schema / properties / views
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Views",
      +  "type": "array"
      +}
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the file side effects (writes PNG/SVG), the return artifact (interactive panel with structure, properties, functional groups), and non-obvious behavioral consequences per flag (abbreviate_groups kills hover tooltips; stereo_variants returns a pick list instead of a drawing). It stops short of error behavior for invalid names/SMILES or whether existing files are overwritten.

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

Conciseness4/5

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

Roughly front-loaded: purpose first, then routing, then args. Minor redundancy — the fischer/haworth/all_h options are stated once in prose and again under view — and 'No ChemDraw required' is filler, but no sentence is genuinely wasteful.

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

Completeness5/5

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

Eight parameters, no annotations, and an output schema. The description covers routing, all parameter semantics, side effects, and the return artifact, so an agent can call it correctly without reading anything else.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must supply all meaning, and it does: formats lists allowed values and the default, view names its three accepted values, render_style enumerates all four modes with intent, and the boolean flags each explain their effect (CIP R/S and E/Z labels; abbreviation set Ph/Bn/OAc/...; max 3 stereoisomer pick list).

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

Purpose5/5

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

The opening sentence gives a specific verb and resource ('draw one compound as a 2D structure') plus its scope ('the default for a single substance'). It then enumerates non-obvious inputs that also route here (bare compound name, a behavior question like acidity/solubility, Fischer/Haworth projections) and names each sibling that handles the other cases.

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

Usage Guidelines5/5

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

An explicit 'Not this tool for:' block routes to batch_generate (several structures), compare_molecules (differences), generate_reaction (reaction schemes) and lookup_molecule_data (data sheets). Positive triggers are also given, including indirect ones like a question about why a compound behaves as it does.

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