Skip to main content
Glama

export_pdf

Convert a local .docx to PDF using Microsoft Word, returning the PDF path, SHA-256 hash, and page count without modifying the source file.

Instructions

Render a local .docx to PDF via Microsoft Word and report its page count.

output_path must fall inside VERIFIED_DOCX_MCP_ALLOWED_FILE_ROOTS (defaults to the user's home directory), must not resolve to a credential path, and its parent directory must already exist. This is a read/render tool: the source .docx is never modified (Word opens a private staged copy — see render.py), so the return value has no "applied" key.

Returns pdf_path, sha256, page_count (best-effort; None — never a guessed 0 — when it cannot be determined), page_count_source ("word"|"pdfinfo"|"regex"|None), engine ("word"; the only engine, D2: no LibreOffice), and left_open_document (the rendered document's window title in Word — see render.py's module docstring for why it is never auto-closed).

Errors: INVALID_INPUT - a bad path or output_path RENDER_ENGINE_UNAVAILABLE - no render engine available (Word only) AUTOMATION_NOT_GRANTED - macOS declined Automation control of Word for this app; run verified-docx-mcp doctor for the fix, scoped to the app hosting this MCP server's own process WORD_SANDBOX_UNAVAILABLE - Word has never been launched on this machine (its sandbox container does not exist yet) RENDER_FAILED - any other Word automation failure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
output_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
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, and it delivers: it discloses that the source .docx is never modified (Word opens a private staged copy), that page_count is best-effort and never a guessed 0, that left_open_document is never auto-closed (with a pointer to render.py for why), and enumerates all error conditions with their meanings. This is exemplary behavioral disclosure.

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 dense and information-rich, with clear section breaks for return values and errors. It is longer than typical, but every sentence earns its place by disclosing constraints, behavior, or error handling. It is front-loaded with the core purpose and then systematically covers edge cases. Slightly verbose in the error section, but justified for a tool with complex failure modes.

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 (Word automation, sandbox, macOS permissions, best-effort page count), the description covers all critical aspects: input constraints, output format, error taxonomy, and behavioral quirks. The output schema exists, so return values are further structured. Nothing an agent needs to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 compensate. It does not explicitly define 'path' beyond 'a local .docx', but it thoroughly defines output_path constraints and the return value semantics. The description adds substantial meaning to output_path and the overall behavior, though 'path' itself is only implicitly described as the source .docx. This is strong compensation for a 0% coverage schema.

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 opens with a specific verb and resource: 'Render a local .docx to PDF via Microsoft Word and report its page count.' This clearly distinguishes it from the only sibling (lock_status), which is about lock state, not document conversion. The purpose 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 Guidelines5/5

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

The description explicitly states constraints on output_path (must fall inside VERIFIED_DOCX_MCP_ALLOWED_FILE_ROOTS, must not resolve to a credential path, parent must exist), and clarifies this is a read/render tool, not a mutating one. It also names the only engine (Word) and explicitly says no LibreOffice, which is a clear exclusion. This is strong when-to-use 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