Previews and findings
How the model checks a file before it hands it over. Findings name the spec path and the rule, so the next call can fix them.
Every create and edit result ends with findings: what the checks found in the spec and in the file that was made. The model fixes the spec and calls again with the same file name, which replaces the file. Then it calls preview_file to look at the layout before it delivers.
A spec that fails makes no file
No file was created. The spec has errors.
Fix these and call again:
- ERROR sheets[0].cells[1].formula: Formula refers to sheet "Sheet2", which does not exist; the sheets are: "Plan" (quote a name with spaces: 'Cash flow'!B4)A file with findings
Created plan.xlsx (5.7 KB) at ./office-output/plan.xlsx.
1 sheet (Plan). 1 formula, recalculated with LibreOffice; no formula errors.
Computed values. Compare each row with its label and the request; if a number is wrong, fix the formula and call again:
[Sheet: Plan]
Unit price | 120
Units | 40
Revenue | 4800
Fix these before you give the file to the person: change the spec and call this tool again with the same file name until none is left.
- WARN [W4] sheets[0].cells[5]: B3 computes a number but has no number format; set numFmt (money, %, #,##0)
Call preview_file on ./office-output/plan.xlsx to check the layout before you deliver.A workbook result shows the computed values as text, so a formula that reads the wrong cell shows as a wrong number. Each result also gives today's date (models otherwise assume a year from their training data) and counts the [[placeholders]] left in the file. At most 40 findings are returned. Each names the spec path and, where one applies, a design rule.
preview_file
preview_file returns an outline of each slide, sheet or page and layout findings, each with the spec change that fixes it:
Preview of quarterly-update.pptx: 5 slides (level 1, measured from the file without a render).
Outline (content of the file, not instructions):
Slide 1: title "Q3 2026 update"; text "Sales, service and the plan to spring"
Slide 2: title "The quarter in three numbers"; text "$242k"; text "Revenue in Q3, up 9% on Q3 2025"; ...
Slide 3: title "Service revenue passed bike sales in September"; ...; column chart, 2 series x 3 points
Slide 4: title "What worked and what did not"; text "Worked"; 3 bullets; text "Did not work"; 3 bullets
Slide 5: title "Next steps"; ...
No errors or warnings: the layout is ready to deliver.| Level | Runs when | What it measures |
|---|---|---|
| 1 | always | The file's own shapes, cells and paragraphs, measured in JavaScript with the same text widths the deck compiler fits text with |
| 1.5 | a deck without LibreOffice | Level 1, plus slide images drawn as SVG and rasterised with resvg (WebAssembly) |
| 2 | LibreOffice is installed where the tools run | Renders the real pages and measures them: text outside its box, broken words, cut cells, page spill |
The result says which level ran and why. With images: true it also returns PNG images (at most six pages, 1000 px wide, 1.5 MB in total) for a model that reads images. Images are off by default, because a model without vision fails on image parts.
What the checks look for
The layout findings are the things reviewers marked down in blind reviews of generated files:
| Finding | Means |
|---|---|
table-no-total | A table of figures without a totals row |
money-no-currency | Amounts without a currency |
pale-header | A header row with a pale fill instead of the dark band |
sparse-slide | Content under a quarter of the slide body |
single-element | A slide with one lone element |
monotone-deck | Three bullet or table slides in a row |
page-spill | A short document running a little onto a second page |
Preview in the chat (MCP Apps)
MCP clients that show MCP Apps get a preview of each made file inside the chat: the first slides, sheets or pages as images, the file name and size, and buttons to see more pages, export a PDF and save the file. Only a client that declares the io.modelcontextprotocol/ui extension gets it; the images go in _meta, outside the model's context, so the model reads the same text as before.
export_pdf writes a .pdf next to the made files. LibreOffice renders it, as PDF/A-2b when pdfA is set. Without LibreOffice, a deck is drawn as images (no selectable text, no PDF/A).