Skip to main content
Glama

files_export_pdf

Read-onlyIdempotent

Exports sheets as a PDF with Excel-style print semantics and returns it base64-encoded. Options mirror Excel's Page Setup: paper size, orientation, margins (inches), zoom or fit-to-pages scaling, page order, centering, gridlines and headings, header/footer with Excel codes (&P page, &N total, &D date, &T time, &F file, &A sheet, &B bold); numbered date and time codes (&D1…&D6, &T1, &T2) take their strings from printedValues, since locale and timezone are the caller's to decide. Each sheet may carry its own saved Page Setup (page setup, print area, print titles, manual breaks — set in the app or imported from xlsx); export uses it by default. sheetOptions[sheetId] overrides the saved values field by field (an empty string or empty list clears one for this export), sheetOptions[sheetId].pageSetup overrides the saved page setup, and the top-level pageSetup applies only to sheets without a saved one. repeatFrozenRows/repeatFrozenCols repeat whatever each sheet has frozen, so a book prints every sheet with its own header; explicit repeat rows/columns win over them. Images placed in cells are printed from the file itself (PNG and JPEG; other formats become a framed placeholder). Rasters a document may unpack are capped: past the cap an image is drawn as a framed placeholder instead. Charts print from the snapshot the client stores in the file, so they come out on every sheet, server-side too; chartImages (base64 PNG keyed by "sheetId!x,y") overrides it, and a chart without a snapshot becomes a framed placeholder — a workbook imported through this API carries no snapshots until a client opens it, so pass chartImages to print its charts. Read-only. Signature: files_export_pdf(file_uuid, options?).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_uuid": "<file_uuid>"
    },
    "name": "files_export_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
optionsNoPrint options: { sheetIds?, fileName?, printedAt?, printedTime?, printedValues?: { "D1"…"D6", "T1", "T2" }, pageSetup?: { paperSize, orientation, margins, scaling, pageOrder, centerHorizontally, centerVertically, printGridlines, printHeadings, repeatFrozenRows, repeatFrozenCols, header, footer }, sheetOptions?: { "<sheetId>": { pageSetup?, printArea: "A1:F20", repeatRows: "1:2", repeatCols: "A:B", rowBreaks: [5, 20], colBreaks: [3] } } — rowBreaks and colBreaks are 1-based track numbers a new page starts at, never column letters, chartImages?: { "<sheetId>!x,y": base64 PNG } }. Header and footer sections take &P, &N, &D, &T, &F, &A, &B, &I and && ; numbered date and time formats (&D1…&D6, &T1, &T2) print from printedValues. Omit for the sheets' saved setup, or A4 portrait at 100% zoom where nothing is saved; all sheets.
file_uuidYes

Output Schema

NameRequiredDescriptionDefault
sizeYes
file_uuidYes
pdf_base64Yes
content_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description goes well beyond them: it discloses the base64 return, the raster cap that degrades images to framed placeholders, unsupported image formats becoming placeholders, chart snapshot sourcing and its server-side consequence, and the reason locale/timezone-dependent date codes come from printedValues. This is exactly the kind of behavior an agent cannot infer from structured fields.

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 and return type, and nearly every clause carries a real rule (override precedence, placeholder fallbacks, header/footer codes). However it is one undifferentiated block of prose with no grouping, and the closing 'Signature: files_export_pdf(file_uuid, options?)' restates the schema and earns no place.

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 two parameters where one is a deeply nested options object, an output schema, and heavy annotation coverage, the description covers everything an agent needs: default behavior when options are omitted, override semantics, capability limits (image caps, missing chart snapshots), and input formats. Nothing material is left to inference.

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?

With 50% schema coverage and deep nesting, the description supplies the precedence hierarchy that the schema cannot express: sheetOptions overrides saved values field by field, an empty string or list clears a value for this export, sheetOptions.pageSetup beats saved page setup, and top-level pageSetup applies only to sheets without a saved one. It also clarifies explicit repeat rows/columns win over repeatFrozenRows/Cols and that chartImages keys are 'sheetId!x,y'.

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 ('Exports sheets as a PDF') plus the return form (base64-encoded). No sibling tool in the list produces a PDF, and the description makes clear this is a rendering/export operation rather than a read or write, so disambiguation is implicit and complete.

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?

Gives concrete usage context: omit `options` to use each sheet's saved Page Setup (falling back to A4 portrait at 100% zoom), and pass `chartImages` specifically when a workbook was imported through the API because it carries no chart snapshots. It lacks an explicit 'do not use this for X' exclusion, but no sibling competing tool exists, so the gap is minor.

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