Skip to main content
Glama

extract_cdxml_from_office

Extract embedded ChemDraw objects from Office files (PPTX, DOCX, XLS, XLSX) and convert them to CDXML files.

Instructions

Extract embedded ChemDraw objects from a PPTX, DOCX, XLS, or XLSX file.

Office files (PPTX/DOCX/XLSX) are ZIP archives that may contain ChemDraw OLE objects as binary blobs. XLS files are OLE2 compound documents with embedded ChemDraw objects stored in MBD* sub-storages. This tool extracts every ChemDraw object, converts it to CDXML, and writes the files to output_dir.

Requires: olefile. CDX→CDXML conversion uses available backends.

Args: file_path: Path to a .pptx, .docx, .xlsx, or .xls file. output_dir: Directory for extracted CDXML files. Default: a folder named "_chemdraw/" next to the input file.

Returns: Dict with keys: ok, input, output_dir, objects (list of: source_path, cdxml_output, cdx_output, error for each extracted object). Returns {ok: False, error: "..."} if extraction fails entirely.

Safety override: Extract every object transactionally; publish nothing on partial failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
output_dirNo
Behavior4/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 explains the extraction process, the conversion to CDXML, output directory behavior, the return dictionary structure, and failure semantics ('publish nothing on partial failure'). This exceeds what would be expected for a simple extraction tool.

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 relatively long but well-structured into logical sections (purpose, technical detail, requirements, args, returns, safety). The purpose is front-loaded, and every sentence contributes value (e.g., file format internals, transactionality). A minor deduction for verbosity that could be tightened.

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?

The description is complete for an extractor tool with no output schema. It details supported inputs, conversion backends, dependencies (olefile), output directory default, return keys, and failure handling. An agent has everything needed to call it correctly without additional inference.

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%, yet the description fully compensates by specifying the file path types ('a .pptx, .docx, .xlsx, or .xls file') and the output_dir default ('a folder named "<basename>_chemdraw/" next to the input file'). This adds semantic meaning beyond the bare schema field names.

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 a specific verb ('extract'), a specific resource ('embedded ChemDraw objects from a PPTX, DOCX, XLS, or XLSX file'), and differentiates from sibling tools like convert_cdx_cdxml (file format conversion) and extract_structures_from_image (image extraction). The scope is unambiguous.

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 scopes usage to office files and explains the underlying storage (ZIP vs OLE2) for each format, which helps an agent understand when this tool applies. It does not explicitly name alternatives to avoid, but the format-specificity combined with sibling tool names provides adequate guidance.

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