Skip to main content
Glama

Sheet to PDF

sheet_to_pdf
Read-onlyIdempotent

Use this when the user wants to turn a spreadsheet, CSV or Excel sheet into a PDF, print a table with the header row on each page, or fit a wide sheet on one page width. Takes one attached CSV, TSV or .xlsx file (or CSV text), an optional sheet name and column list, paper (letter, a4, legal, a3), orientation, font size 7-12, row numbers, page numbers and a title, and returns a PDF download with the page count and a check that each printed cell was found again in the new PDF. Excel values print as displayed. Does not print charts, images, cell colors or merged-cell layouts, and does not open legacy .xls files. Do not use for PDF to Excel conversion.

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": "sheet_to_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoThe sheet to print: a CSV, TSV or Excel .xlsx file, e.g. inventory.xlsx or contacts.csv.
paperNoPaper size, e.g. a4. Default letter.
sheetNoFor .xlsx: the sheet name to print, e.g. "Q3 Sales". Default: the first visible sheet.
titleNoOptional title above the table on page 1, up to 120 characters, e.g. "Inventory, November 2026".
columnsNoPrint only these columns, in this order, by header name or column letter, e.g. ["Name", "Email", "Total"]. Default: all columns.
csv_textNoInstead of a file: the table as CSV text with a header row, e.g. "Name,Qty\nApples,3\nPears,5". Use either file or csv_text.
delimiterNoFor CSV text: the separator, e.g. semicolon. Default: detected from the file.
fit_widthNotrue (default): when columns are too wide, the font gets smaller (down to 7 pt) before cells wrap. false: keep font_size and wrap cell text.
font_sizeNoFont size in points from 7 to 12, e.g. 9 (default).
has_headerNotrue (default): the first non-empty row is the header row (one-cell title rows above it are printed as the title). false: columns are named Column A, Column B, ...
header_rowNoThe sheet row (or CSV line) number that holds the header, e.g. 3 when rows 1-2 hold a title. Rows above it are left out. Default: detected.
orientationNoPage orientation, e.g. landscape. auto (default) picks portrait when the columns fit, else landscape.
row_numbersNotrue adds a # column with row numbers 1, 2, 3. Default false.
page_numbersNotrue (default) prints Page 1 of N in each page footer.
include_hiddenNoFor .xlsx: true also prints hidden rows and columns. Default false (as Excel prints).

Output Schema

NameRequiredDescriptionDefault
fileYes
checkYes
notesYes
pagesYes
paperYes
sheetYes
columnsYes
previewYes
cut_cellsYes
data_rowsYes
downloadsYes
font_sizeYes
orientationYes
output_nameYes
preview_countNo
output_size_kbYes
printed_columnsYes
expires_in_hoursYes
replaced_charactersYes
printed_columns_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive, idempotent, closed-world), and the description adds genuinely new behavior: values print as displayed, a per-cell verification check, and the list of unsupported content (charts, images, colors, merged cells) plus .xls rejection. Return format is partly described, though the page-count/cell-check detail is only skimmed.

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?

Use cases are front-loaded in the first sentence and the limits come last, which is good ordering. The middle sentence is a long run-on enumerating parameters that largely duplicates the schema, making it denser than it needs to be.

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 15-parameter tool with nested file object, enums and an output schema, the description covers purpose, input formats, unsupported content, and verification behavior. Nothing critical for correct invocation appears missing.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter is already documented. The description restates the major inputs (paper sizes, orientation, font size 7-12, row numbers, page numbers, title, sheet, columns) without adding defaults or constraints beyond what the schema provides, so the baseline 3 applies.

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 (turn a spreadsheet/CSV/Excel sheet into a PDF) and enumerates concrete goals: header row on each page, fit wide sheet on one page width. It also rules out a neighbouring operation (PDF to Excel) and is clearly distinct from the inspect_sheet sibling.

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?

Opens with explicit 'Use this when the user wants to...' triggers and adds exclusions: 'Does not print charts, images, cell colors or merged-cell layouts, and does not open legacy .xls files. Do not use for PDF to Excel conversion.' The agent knows both when to pick it and when not to.

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