build_xlsx_workbook — Build Styled Multi-Sheet XLSX Workbook

Compiles 1–20 structured JSON datasets into a genuine Office Open XML (.xlsx) workbook with bold shaded headers, frozen top rows, auto-sized columns, numeric formatting, formula-injection protection, and live Excel summary formulas (SUM, AVERAGE, MIN, MAX, COUNT).

Why buy vs. DIY: Generates compliant PKZIP/OpenXML spreadsheets at the edge in <15ms without Python, openpyxl, SheetJS bloat, or broken CSV exports.

Pricing: $0.003 USD per multi-sheet .xlsx workbook generation (x402 instant micropayment) · REST: POST https://sheet-sql.apikeg.com/v1/build-xlsx-workbook · MCP: https://sheet-sql.apikeg.com/mcp

Input Parameters

FieldTypeRequired / DefaultDescription & Constraints
fileName string Default: "workbook.xlsx" Output .xlsx filename metadata (automatically suffixed with .xlsx if omitted). (minLength: 1, maxLength: 128)
sheets array Required 1 to 20 worksheets to compile into the multi-tab .xlsx archive. (minItems: 1, maxItems: 20)

REST Example (curl)

curl -X POST "https://sheet-sql.apikeg.com/v1/build-xlsx-workbook" \
  -H "Content-Type: application/json" \
  -d '{
  "fileName": "q4-revenue-summary.xlsx",
  "sheets": [
    {
      "name": "Regional Revenue",
      "freezeHeader": true,
      "coerceCurrencyNumbers": true,
      "allowCellFormulas": false,
      "summaryRowFormulas": {
        "q4_revenue": "SUM",
        "win_rate": "AVERAGE"
      },
      "rows": [
        {
          "region": "North America",
          "q4_revenue": 125000.5,
          "win_rate": 0.34
        },
        {
          "region": "Europe",
          "q4_revenue": 84500.25,
          "win_rate": 0.29
        }
      ]
    }
  ]
}'

MCP tools/call Payload

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "build_xlsx_workbook",
    "arguments": {
      "fileName": "q4-revenue-summary.xlsx",
      "sheets": [
        {
          "name": "Regional Revenue",
          "freezeHeader": true,
          "coerceCurrencyNumbers": true,
          "allowCellFormulas": false,
          "summaryRowFormulas": {
            "q4_revenue": "SUM",
            "win_rate": "AVERAGE"
          },
          "rows": [
            {
              "region": "North America",
              "q4_revenue": 125000.5,
              "win_rate": 0.34
            },
            {
              "region": "Europe",
              "q4_revenue": 84500.25,
              "win_rate": 0.29
            }
          ]
        }
      ]
    }
  }
}