Skip to main content
Glama

render_scheme

Render chemical reaction schemes to publication-ready CDXML from YAML, compact text, or reaction JSON. Output as CDXML string or file.

Instructions

Render a chemical reaction scheme to publication-ready CDXML.

Accepts exactly ONE of: yaml_text, compact_text, or json_path. Call with NO arguments to see the full YAML schema reference.

  • yaml_text: Write YAML with structures (ID + SMILES) and steps (substrates, products, above/below arrow).

  • json_path: Path to reaction JSON from parse_reaction (auto-layout).

IMPORTANT: Every SMILES in the YAML must come from a tool — resolve_name, modify_molecule, parse_reaction, extract_structures_from_image, etc. Never write SMILES from built-in chemistry knowledge or from reading an image with vision. Always call the appropriate tool first, then use the SMILES from its output in your YAML.

Convention: ONE substrate on center line per step. Additional reagents go in above_arrow (structures or text). This shares intermediates between sequential steps.

Args: yaml_text: YAML scheme descriptor string. compact_text: Compact DSL syntax string. json_path: Path to a reaction JSON file. layout: Layout for json_path: "auto", "landscape", "portrait". output_path: If given, write the CDXML to this file and return {ok, output_path, size} instead of the raw CDXML string.

Returns: CDXML string (when output_path is None), or {ok, output_path, size} when output_path is provided, or YAML schema reference if called with no arguments.

Safety override: Render a scheme through a validated no-overwrite staging file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layoutNoauto
json_pathNo
yaml_textNo
output_pathNo
compact_textNo
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It discloses that calling with no arguments returns the YAML schema reference, that output_path writes to a file, and mentions a safe staging mechanism ('validated no-overwrite staging file'). It also instructs against using built-in chemistry knowledge for SMILES. This goes beyond a minimal description but does not detail side effects like file permissions or potential destructive operations beyond the no-overwrite claim.

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?

The description is well-structured with sections for purpose, usage, args, returns, and a safety note. It is somewhat long but every sentence adds value, such as the SMILES sourcing warning and the convention for one substrate. The front-loaded purpose and clear parameter descriptions make it effective despite its length.

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 tool has 5 parameters, no output schema, and no annotations, the description provides all necessary information: input formats, workflow guidance, return types, and how to obtain the full YAML schema. It even covers the safety override. An agent has enough to call the tool correctly without ambiguity.

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 fully compensates. It explains each parameter (yaml_text, compact_text, json_path, layout, output_path), their mutual exclusivity, and the layout values. It also clarifies the return behavior based on output_path. This adds substantial meaning beyond the raw schema types and defaults.

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 tool renders a chemical reaction scheme to publication-ready CDXML, specifying the verb, resource, and output. It differentiates from siblings like parse_scheme and clean_scheme_layout by emphasizing the publication-ready CDXML output and the accepted input formats (YAML, compact DSL, JSON from parse_reaction).

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

Usage Guidelines3/5

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

The description provides usage context such as accepting exactly one of three input formats, the workflow of getting SMILES from other tools, and the convention for one substrate per step. However, it does not explicitly state when to use this tool versus siblings like render_to_png or clean_scheme_layout, and there are no explicit exclusions or alternative tool recommendations.

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