Skip to main content
Glama

Draw a structure

generate_molecule
Idempotent

Draw one compound as a 2D PNG/SVG structure with properties and functional groups; use for single substances, projections, chair forms, or all stereoisomers.

Instructions

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

Writes PNG/SVG files and an interactive panel (properties, 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. A Fischer or Haworth projection of a sugar or amino acid, a chair conformation of a cyclohexane or pyranose ring, or a drawing with all H atoms, is this tool too: set view to "fischer", "haworth", "chair" or "all_h". All stereoisomers of one compound are this tool too: set stereo_variants=True (meso forms counted once).

Not this tool for: several individual structures (use batch_generate), structural differences (use compare_molecules), a reaction scheme (use generate_reaction), a data sheet (use lookup_molecule_data), a single named value such as melting point, CAS number or GHS hazards (use lookup), the IR bands or ¹H signals to expect (use predict_spectrum), a spectrum drawing (use generate_spectrum), which species of an acid dominates at a given pH (use generate_species_distribution), a rotatable 3D model or the shape in space (use generate_3d), or a protein, enzyme or antibody (use generate_protein_or_antibody).

Args: name_or_smiles: English/IUPAC name or SMILES. Peptides: "Ala-Gly-Ser" (D-Ala, Ac-, -NH2, cyclo(…)); one-letter only as "peptide:AGS" (lowercase = D). label: Display name below the structure (may be localized). formats: any of "png", "svg", "cdxml" (default png + svg; cdxml only for ChemDraw). annotate_stereo: True prints CIP descriptors (R/S, E/Z). abbreviate_groups: True draws substituents as labels (Ph, OAc, Boc). render_style: "", "compact", "presentation" or "grayscale". stereo_variants: True lists all stereoisomers (max 3 open centers) as a pick list; only when the user asks for them. view: "fischer"/"haworth"/"chair"/"all_h" opens on that drawing, only if the user names it.

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": {
      "name_or_smiles": "<name_or_smiles>"
    },
    "name": "generate_molecule"
  }
}

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
foundAsNo
messageNo
proteinNo
viewSvgNo
lipinskiNo
subtitleNo
viewAtomsNo
candidatesNo
cdxml_pathNo
propertiesNo
stereoNoteNo
initialViewNo
viewRequestNo
projectionNoteNo
stereoWarningsNo
functionalGroupsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.0
    • addedOutput schema / $defs / ProteinView
      Added value: +{
      +  "description": "Protein cartoon for the panel (backbone N/Cα/O, secondary structure, bound groups).",
      +  "properties": {
      +    "chains": {
      +      "default": [],
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "title": "Chains",
      +      "type": "array"
      +    },
      +    "citation": {
      +      "default": "",
      +      "title": "Citation",
      +      "type": "string"
      +    },
      +    "colorBy": {
      +      "default": "ss",
      +      "title": "Colorby",
      +      "type": "string"
      +    },
      +    "identifier": {
      +      "default": "",
      +      "title": "Identifier",
      +      "type": "string"
      +    },
      +    "ligands": {
      +      "default": [],
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "title": "Ligands",
      +      "type": "array"
      +    },
      +    "plddtMean": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "title": "Plddtmean"
      +    },
      +    "scheme": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "title": "Scheme"
      +    },
      +    "source": {
      +      "default": "",
      +      "title": "Source",
      +      "type": "string"
      +    },
      +    "ssSource": {
      +      "default": "deposited",
      +      "title": "Sssource",
      +      "type": "string"
      +    },
      +    "subtitle": {
      +      "default": "",
      +      "title": "Subtitle",
      +      "type": "string"
      +    },
      +    "title": {
      +      "default": "",
      +      "title": "Title",
      +      "type": "string"
      +    }
      +  },
      +  "title": "ProteinView",
      +  "type": "object"
      +}
    • addedOutput schema / properties / protein
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/ProteinView"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. Changed1 schema field changedv0.8.0
    • addedOutput schema / properties / foundAs
      Added value: +{
      +  "default": "",
      +  "title": "Foundas",
      +  "type": "string"
      +}
  3. 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"
      +}
  4. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false and idempotentHint=true; the description is consistent, disclosing that it writes PNG/SVG/CDXML files plus an interactive panel with properties and functional groups, and that cdxml is only for ChemDraw. It stops short of saying where files land, whether existing files are overwritten, or any size/render limits, which for a file-writing tool is a meaningful remaining gap.

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?

Structure is good: default-scope statement first, then routing, then per-argument notes. It is long, and the negative-routing list spans four dense lines, but each entry maps to a distinct sibling and no sentence is pure restatement.

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?

With an output schema present, return values need no explanation, and the description fully covers invocation decisions, argument semantics, and file side effects. An agent has everything needed to select and call it correctly.

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 carries the full burden and does: it defines name_or_smiles input forms (IUPAC, SMILES, peptide syntax including D-/Ac-/-NH2/cyclo and the "peptide:AGS" convention), allowed formats with defaults, the legal view values, the R/S and E/Z meaning of annotate_stereo, and the constraint that stereo_variants is capped at 3 open centers and only used on request.

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?

Opens with a specific verb and resource ("Draw one compound as a 2D structure") and immediately states the scope ("the default for a single substance"), which lets an agent distinguish it from all 17 named siblings without opening a schema.

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?

Explicitly enumerates when this tool applies (bare name, mechanism questions, Fischer/Haworth/chair/all-H views, stereoisomer requests) and when it does not, naming the exact alternative for each case (batch_generate, compare_molecules, generate_reaction, lookup, predict_spectrum, generate_3d). Nothing is left to inference.

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