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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| target_format | Yes | ||
| output | No | ||
| folder | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||