Skip to main content
Glama

Convert an office document to PDF

convert_to_pdf

Converts an existing Word, Excel, PowerPoint, OpenDocument, RTF or HTML document (up to 20 MB) to a PDF as it is, without filling in data, and returns the render with status and download_url. To make a document from a template and data, use render instead. Pass exactly one source: render_id, the render of a Word or PowerPoint template (output docx or pptx); or file_base64 with file_name, the document itself. Every call is a new render that counts units like a PDF; the Free plan cannot convert (Starter and above). The document is converted and not kept.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "convert_to_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameNoName of the PDF behind download_url, e.g. report.pdf
file_nameNoName of the document, e.g. report.xlsx; the type is read from the content
landscapeNoLandscape for spreadsheets and documents without their own page setup
render_idNornd_ id of a render whose output is docx or pptx, to get that document as a PDF
file_base64NoThe document to convert, base64 encoded; needs file_name
page_rangesNoPages to convert, e.g. 1-3,5; all pages when left out
single_page_sheetsNoEach spreadsheet sheet on one page

Output Schema

NameRequiredDescriptionDefault
idYesrnd_ id of the render
formNoWhat fill_pdf_form did: the fields filled, those left out (unknown name or invalid value) and those whose calculation or display format no viewer ran
pdfaNoThe PDF/A verdict (PDF/A-2b or PDF/A-3b), when the template declares it
errorYesWhy a failed render failed
unitsYesUnits the render counted
outputNoThe format of the file: pdf, png, jpg, webp, docx or pptx, or zip for the several files of split_pdf and pdf_to_image
statusYes
einvoiceNoThe e-invoice report, when the render made one
templateYesThe template and version rendered; null for html and conversions
expires_atYesWhen download_url stops working; get_render issues a fresh one
page_countYes
environmentYes
download_urlYesSigned link to the file; null until the render succeeded
accessibilityNoThe PDF/UA-1 verdict, when the template declares it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / form
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "What fill_pdf_form did: the fields filled, those left out (unknown name or invalid value) and those whose calculation or display format no viewer ran",
      +  "properties": {
      +    "filled": {
      +      "type": "number"
      +    },
      +    "skipped": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "field": {
      +            "type": "string"
      +          },
      +          "reason": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "field",
      +          "reason"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "warnings": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "field": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "field",
      +          "code"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "xfa_removed": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "filled",
      +    "skipped",
      +    "warnings",
      +    "xfa_removed"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / output
      Added value: +{
      +  "description": "The format of the file: pdf, png, jpg, webp, docx or pptx, or zip for the several files of split_pdf and pdf_to_image",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedOutput schema / properties / pdfa
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "The PDF/A verdict (PDF/A-2b or PDF/A-3b), when the template declares it",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false, idempotentHint=false and destructiveHint=false; the description adds substantive context beyond them: a 20 MB size ceiling, that each call creates a new render and consumes units like a PDF, that the Free plan is blocked, and that the source document is not retained. The non-idempotency claim reinforces rather than contradicts the annotation.

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?

Front-loaded with the core action before the alternatives and billing caveats, and every sentence carries information. The source-mode sentence is dense, packing both modes and their required companions into one clause, but no wording is wasted.

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 seven-parameter conversion tool with full schema coverage, annotations and an output schema, the description covers everything an agent needs: accepted formats, size limit, source selection, cost/plan impact, non-retention and which sibling to use instead. Return values (status, download_url) are only named, appropriately, since the output schema documents them.

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?

With 100% schema description coverage the baseline is 3, but the description adds real meaning the schema cannot express: it pairs render_id with Word/PowerPoint template output (docx or pptx) and pairs file_base64 with file_name, and states the mutual-exclusion rule for the two source modes, which matters because required=0 and the schema enforces no alternative. It does not cover filename, landscape, page_ranges or single_page_sheets, leaving those to the 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?

States a specific verb and resource ('Converts an existing Word, Excel, PowerPoint, OpenDocument, RTF or HTML document ... to a PDF') and immediately narrows scope ('as it is, without filling in data'), which distinguishes it from the template-rendering sibling. An agent can identify the exact input types and the two accepted sources without opening the schema.

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?

Explicitly routes the agent away from this tool when the goal is template-plus-data ('To make a document from a template and data, use render instead'), and gives a hard selection rule between the two source modes ('Pass exactly one source'). It also states the plan-level exclusion (Free plan cannot convert) up front, so an agent knows when the call is not viable at all.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources