Skip to main content
Glama

draw_molecule

Convert a molecule's SMILES into a standalone CDXML document with 2D coordinates and optional label, ready for ChemDraw.

Instructions

Render a single molecule to a standalone CDXML document.

Takes a molecule dict (at minimum {"smiles": "..."}) and generates a self-contained CDXML string with 2D coordinates in ACS Document 1996 style (BondLength=14.40, Arial 10pt). Optionally places a text label below the structure using the "label", "name", or "iupac_name" field (in that order).

IMPORTANT: Do NOT construct {"smiles": "..."} with hand-edited SMILES. Always get mol_json from another tool (resolve_name, modify_molecule, parse_reaction, etc.). If you need to edit a SMILES, use modify_molecule(operation="set_smiles") first — it gives you an MCS diff to verify the edit was correct before drawing.

Args: mol_json: Molecule dict with at least {"smiles": "..."}. Optional display fields: "label" (used verbatim), "name", "iupac_name". Should come from another tool's output, not hand-constructed. output_path: If given, also write CDXML to this file path.

Returns: Dict with keys: ok, cdxml (CDXML document string), and output_path if a path was specified. Returns {ok: False, error: "..."} on failure.

Safety override: Draw a molecule through a validated no-overwrite staging file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mol_jsonYes
output_pathNo
Behavior5/5

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

With no annotations provided, the description carries full burden. It discloses output format (CDXML string), return dict keys (ok, cdxml, output_path), error handling ({ok: False, error: "..."}), and a safety note about no-overwrite staging. This transparently covers all behavioral aspects relevant to an agent.

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

Conciseness5/5

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

The description is well-structured with a leading summary, clear Args/Returns sections, and critical warnings front-loaded. Each sentence provides necessary information without redundancy, balancing depth with conciseness.

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?

Given the complexity of the task (molecule rendering, CDXML output, safety considerations), the description is complete. It covers input requirements, output structure, error cases, sources for valid mol_json, and even a safety override note, leaving no critical information missing.

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 compensate. It fully explains mol_json (minimum required SMILES, optional fields label/name/iupac_name, and the directive to source from other tools) and output_path (optional file write). Every parameter's meaning and constraints are clarified.

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 description clearly states the specific action and resource: 'Render a single molecule to a standalone CDXML document,' and differentiates from sibling tools like render_scheme and render_to_png by specifying output as CDXML with ACS style. The verb 'render' and resource 'molecule' are unambiguous.

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?

Provides explicit usage rules: 'Do NOT construct {"smiles": "..."} with hand-edited SMILES. Always get mol_json from another tool...' and explicitly names the alternative (modify_molecule) for editing SMILES, along with a rationale (MCS diff verification). This fully informs when to use and when not to use the tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZiChenWang114514/cdxml-toolkit-community'

If you have feedback or need assistance with the MCP directory API, please join our Discord server