Tools · Documents and apps

build_document

Can wait for approval

Create a polished PDF report, Excel workbook, Word document, PowerPoint deck, or styled HTML page from structured content.

When to use: Use this whenever the user wants a shareable deliverable — a report, spreadsheet, deck, or doc — rather than chat text.

Example

Run for real by scripts/tool-examples.py in a small demo project, with Haiku 5.5 where the tool calls a model. The output is exactly what the tool returned.

What it rendered

rendered output

The call

tool call
{
  "tool": "build_document",
  "arguments": {
    "kind": "html",
    "title": "Pricing brief",
    "sections": [
      {
        "heading": "Summary",
        "body": "Seat-based pricing with two plans; annual billing ships in 0.2.0."
      },
      {
        "heading": "Plans",
        "table": {
          "headers": [
            "Plan",
            "Per seat / month"
          ],
          "rows": [
            [
              "Starter",
              "$12"
            ],
            [
              "Team",
              "$29"
            ]
          ]
        }
      },
      {
        "heading": "Next",
        "bullets": [
          "Enterprise tier",
          "Usage-based add-ons"
        ]
      }
    ]
  }
}

Real output

Created HTML 'Pricing brief' → <project>/.shipit_workspace/documents/pricing_brief.html (849 bytes)

Parameters

NameTypeDescription
kind*stringOutput formatdocxhtmlpdfpptxxlsx
title*string—
sectionsarrayDocument content (pdf/docx/pptx/html). For pptx each section is one slide.
sheetsarrayWorkbook content (xlsx only). Cell strings starting with '=' become live formulas.
pathstringOptional output path; defaults to the workspace with a name derived from title.

* required

Build documents, dashboards and small apps people can open.