Skip to main content
Glama

convert_document

Converts Office documents (DOCX, XLSX, PPTX) to PDF, HTML, or CSV. Automatically selects the right exporter based on file extension.

Instructions

Convert a .docx/.xlsx/.pptx file to pdf/html/csv.

Dispatches to the format-specific exporter based on the source file's extension and the requested target_format. When output is omitted, the output is written next to the source with the new extension (VAL-GEN-024).

Args: path: Path to an existing Office file. target_format: One of "pdf", "html", "csv". The match is case-insensitive and a leading dot is tolerated. output: Optional target path for the converted file. When None (default), a sibling of the input is used. Relative paths are resolved against folder (or the default folder). folder: Optional base folder for relative paths.

Returns: {"output_path": "<absolute path>", "format": <target>} where format is the lower-cased, dot-stripped target format (e.g. "pdf").

Raises: OfficeMCPError: ERR_INVALID_PARAMS for unknown target_format, ERR_FILE_NOT_FOUND if the source is missing, ERR_UNSUPPORTED_FMT for an unsupported (source, target) combination (e.g. .docx.csv, or any non-Office source), or any error propagated from :mod:office_mcp.exporters (ERR_LIBREOFFICE_MISSING, ERR_EXPORT_FAILED).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
target_formatYes
outputNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully bears the burden of behavioral disclosure. It details the output path behavior when omitted (VAL-GEN-024), relative path resolution against folder, error types for invalid parameters, missing files, unsupported formats, and LibreOffice issues. This comprehensive coverage exceeds typical expectations.

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 (Args, Returns, Raises) and concise sentences. However, it is somewhat lengthy; the error list could be shortened. Still, every sentence serves a purpose, and key information is front-loaded.

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 (4 parameters, no schema descriptions, no annotations, but with output schema), the description covers purpose, parameter details, default behaviors, error scenarios, and return value. It is self-contained and leaves minimal gaps for an agent to infer.

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%, meaning the input schema offers no parameter descriptions. The tool's description adds substantial meaning: explaining target_format case-insensitivity and leading dot acceptance, output default sibling path, relative path resolution via folder, and the return format. This completely compensates for the schema gap.

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 verb 'convert' and specifies the resource: '.docx/.xlsx/.pptx' files to 'pdf/html/csv'. It distinguishes itself from sibling-specific export tools by mentioning dispatching to format-specific exporters and listing supported conversions, making its purpose unique and 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 explains when to use the tool (converting Office files) and lists supported target formats. It implies not to use for unsupported combinations by raising an error. However, it does not explicitly state when to use dedicated export tools (e.g., excel_export_pdf) versus this generic converter, leaving some ambiguity.

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/gawirable/office-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server