Skip to main content
Glama

convert_cdx_cdxml

Convert CDX and CDXML files bidirectionally, with automatic direction detection from file extension and backend selection for accurate chemical data conversion.

Instructions

Convert bidirectionally between CDX (binary) and CDXML (XML) formats.

Direction is detected from the file extension:

  • .cdx input → .cdxml output

  • .cdxml input → .cdx output

Uses available backends in order: ChemDraw COM (best fidelity, Windows) → pycdxml (pure Python, partial support) → OpenBabel.

ChemDraw COM requires ChemDraw to be installed and closed before running.

Args: input_path: Path to .cdx or .cdxml file. output_path: Output file path. If not given, same directory as input with the swapped extension (e.g. foo.cdx → foo.cdxml).

Returns: Dict with keys: ok, input, output (absolute path to written file). Returns {ok: False, error: "..."} if conversion fails.

Safety override: Convert CDX/CDXML through a validated no-overwrite staging file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_pathYes
output_pathNo
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly describes the conversion logic (extension detection), backend selection and prerequisites, the return dict format including error handling, and even a safety override for no-overwrite staging. This leaves little to inference and fully informs the agent of expected behavior and side effects.

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 clear sections and front-loaded purpose. It is slightly longer than minimal but every sentence adds value: backend details, prerequisites, return format, and safety. The safety override line, while specific, is useful context. It could be trimmed by omitting the explicit 'Returns' dict details, but it remains efficient and readable.

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's complexity (backend selection, extension detection, output defaults, error handling), the description covers all necessary aspects. It explains the return dict even though no output schema exists, making it fully complete for an agent to invoke correctly. No critical information is 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 fully compensate. The Args section explains both parameters: input_path (a path to .cdx or .cdxml) and output_path (optional, with detailed default behavior: same directory, swapped extension). This adds essential meaning beyond the bare schema and clarifies the exact usage of each parameter.

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 converts bidirectionally between CDX and CDXML formats, with the direction determined by file extension. This is a specific verb-resource pair that distinguishes it from sibling tools like render_cdxml_files (rendering) or extract_cdxml_from_office (extraction), leaving no ambiguity about its core function.

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

Usage Guidelines4/5

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

The description explains when the tool is used (conversion) and provides backend selection details, including the requirement that ChemDraw COM needs ChemDraw installed and closed. It does not explicitly exclude alternative tools, but the purpose is clear enough that an agent would know to use this for CDX/CDXML conversion. It also notes the backend fallback order, offering practical guidance on expected behavior.

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