Skip to main content
Glama

parse_scheme

Convert a CDXML reaction scheme file into structured JSON with species, steps, topology, and a summarized narrative for analysis.

Instructions

Parse a CDXML reaction scheme into a structured description.

Reads a CDXML file containing a reaction scheme (single- or multi-step) and returns a structured JSON with a species registry, reaction graph, topology classification, and a natural language narrative suitable for LLM reasoning.

Uses two strategies in order: step-attribute path (reads attributes if present) then geometry-based fallback (spatial arrow detection). Text labels near arrows are classified as "chemical", "condition_ref", "footnote", "yield", "compound_label", "citation", or "bioactivity".

Args: cdxml_path: Path to a CDXML file containing a reaction scheme. output_path: If given, write the result JSON to this file and return {ok, output_path, size} instead of the full dict.

Returns: Dict with keys: source_file, species (dict of species records with smiles, name, formula, mw, role, text_category), steps (list with reactant/product/reagent species IDs and conditions), topology (linear/parallel/convergent/divergent), content_type, narrative (human-readable summary), and optionally sub_schemes for multi-panel files. When output_path is provided, returns {ok, output_path, size}.

Safety override: Parse a scheme and atomically publish its JSON descriptor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cdxml_pathYes
output_pathNo
Behavior4/5

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

With no annotations, the description carries full disclosure burden. It reveals the dual parsing strategies, label classifications, and the side effect of writing to output_path when provided. The cryptic 'Safety override: Parse a scheme and atomically publish its JSON descriptor' is vague but does hint at a publishing behavior. Overall it is transparent about the tool's actions and return structure, though it leaves some ambiguity around the safety override.

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

Conciseness3/5

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

The description is long and detailed, but logically organized with an opening summary, strategy explanation, argument details, and return structure. Some elements (the lengthy list of label categories, the safety override sentence) add noise and could be trimmed. Still, it remains readable and front-loaded with the core purpose.

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

Completeness4/5

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

For a complex tool with minimal schema and no output schema, the description is thorough: it specifies all major output keys, strategies, and the optional output_path behavior. It does not address error handling, file format specifics, or prerequisites, but for the core invocation and expected result it is sufficiently complete.

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 fully explain parameters. It does: cdxml_path is clearly defined as a path to a CDXML file containing a reaction scheme, and output_path explains the conditional write behavior and the altered return shape. This adds significant meaning beyond the bare schema types.

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 opens with a clear verb and resource: 'Parse a CDXML reaction scheme into a structured description.' It then enumerates exactly what the output contains (species registry, reaction graph, topology classification, narrative) differentiating it from mere conversion or rendering siblings. This is unambiguous and actionable.

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

Usage Guidelines2/5

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

The description explains how the tool works internally (strategies, classification) but never states when to choose it over siblings like parse_reaction, summarize_reaction, or extract_structures_from_image. No explicit 'use this when...' or 'for X instead' guidance is provided, leaving the agent to infer applicability from the function alone.

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