Build with the rainfall workbook
Run the same seven-day case in JavaScript, inspect a native incremental calculation through MCP, or give the workflow to an agent.
Open the editable workbook →Browser API
Paste this into a browser console or import the module in your own web app. Each call uses the local Graph Computer WebAssembly kernel. The result contains the roof area, dated observations, scenario readings, daily litres and the weekly total.
const { calculateRainfall } = await import("https://graphcomputer.hopperlabs.ai/runtime/rainfall.js");
const observed = await calculateRainfall(100);
const rain = observed.days.map(day => day.rain);
rain[4] = 10.1; // Nov 22: the observation was 8.1 mm
const edited = await calculateRainfall(100, rain);
console.log(observed.total, edited.total); // 2620, 2820 litresarea is a positive whole number of square metres. Supply seven finite, non-negative rainfall depths in tenths of a millimetre, earliest date first. Invalid inputs reject the promise. Omit the depths to use the NOAA observations.
Export with Workbook Studio
rainfallWorkbook(area, rain) returns an XLSX Blob for those inputs. The first export fetches Workbook Studio’s codec and template. The calculation and file creation both happen on your device.
const { rainfallWorkbook } = await import("https://graphcomputer.hopperlabs.ai/runtime/rainfall.js");
const file = await rainfallWorkbook(100, [1.8, 6.9, 2.5, 0.3, 10.1, 0, 6.6]);
const url = URL.createObjectURL(file);
const a = document.createElement("a");
a.href = url;
a.download = "rainfall.xlsx";
a.click();
setTimeout(() => URL.revokeObjectURL(url), 1500);Local MCP tools
With Node 26+ and an installed Graph Computer engine checkout, download the two files below into one directory. The runner starts the engine’s stdio MCP server with an in-memory database. No account or model is needed for this local calculation.
Download replay.mjs · Download observations.json
node replay.mjs /path/to/graph-computer/src/mcp.mjs- library.spreadsheet
- Resolve the engine’s calculate program.
- program.run
- Run the original sheet. Pass its sheet reference into the edit, then calculate the edited sheet from scratch for comparison.
- run.verify
- Verify each run. The runner also asserts equality of every edited cell against the full calculation.
The recorded edit to C8 recalculated C8, F8, F11, reused 19 of 22 cells and produced 2,820 litres. The browser column API calculates all seven rows per call.
Inspect the run receipt · Download the verified edited workbook · Workbook verification
Agent skill
Save the linked file as graph-rainfall-workbook/SKILL.md in your client’s skills directory. It includes the inputs, tool sequence, expected values and Workbook Studio verification step.