Skip to main content
Glama

embed_cdxml_in_office

Convert CDXML files into double-clickable, editable ChemDraw OLE objects within PowerPoint or Word documents.

Instructions

Embed a CDXML file as an editable ChemDraw OLE object in PPTX or DOCX.

Converts CDXML → CDX + EMF preview via ChemDraw COM, builds a CFB OLE compound file, and injects it into a PPTX slide or DOCX paragraph as a double-clickable, editable ChemDraw object.

Requires: ChemDraw COM (Windows, ChemDraw 16+), python-pptx or python-docx. ChemDraw must be installed and closed before calling this tool.

The output format (.pptx or .docx) is detected from office_path extension. If office_path does not exist, a new file is created.

Args: cdxml_path: Path to the CDXML file to embed. office_path: Path to the target .pptx or .docx file. Created if it does not exist. output_path: Output file path. If not given, writes to office_path (modifies in place via temp file).

Returns: Dict with keys: ok, input_cdxml, output (absolute path to written Office file), format ("pptx" or "docx"), num_objects_embedded. Returns {ok: False, error: "..."} if embedding fails.

Safety override: Create a new validated PPTX or DOCX and reject all existing targets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cdxml_pathYes
office_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 full behavioral disclosure. It reveals the conversion process (CDXML → CDX + EMF), the OLE compound file construction, in-place modification behavior when output_path is omitted, file creation when office_path doesn't exist, and the exact return dict structure including error handling. The 'Safety override' note adds further transparency about operational constraints.

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 thorough, structured with an Args/Returns section, and front-loaded with the core purpose. It is longer than minimal but every sentence adds necessary detail (prerequisites, behavior, return schema, safety note) without redundancy. Slight verbosity in the explanatory first paragraph could be trimmed, but it remains well-organized.

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?

For a tool with non-trivial complexity (OLE embedding, COM dependency, multiple output modes), the description covers prerequisites, input/output behavior, error conditions, return format, and even a safety override. It leaves no critical ambiguity for an agent to resolve—everything needed for correct invocation and result interpretation is present.

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?

The input schema provides only types and names with zero descriptions (0% coverage). The description fully compensates by explaining each parameter: cdxml_path is the CDXML source, office_path is the target PPTX/DOCX (created if missing, format detected from extension), and output_path is optional with default to office_path. This is significantly more informative than the schema alone.

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 states a precise, specific action: embedding a CDXML file as an editable ChemDraw OLE object into PPTX or DOCX. It names the input, output, and conversion pipeline (CDXML → CDX + EMF via ChemDraw COM). It clearly distinguishes from sibling tools like extract_cdxml_from_office (reverse operation) and batch_embed_cdxml_in_office (batch variant) by its singular-target nature.

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 gives explicit prerequisites (ChemDraw COM, Windows, ChemDraw 16+, python-pptx/docx) and a critical precondition ('ChemDraw must be installed and closed'), which is essential for correct invocation. However, it does not explicitly state when to use this tool versus batch_embed_cdxml_in_office or other alternatives—though the singular-target behavior is implied by the name and description.

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