API & MCP
Everything a person can do on Sizewise How Many Fit, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://sizewisefitcount.usefulweb.app/api/v1/calculate– run Sizewise How Many FitGET https://sizewisefitcount.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Sizewise How Many Fit
Counts how many of one thing fit in another by length, by area, by volume (with the packing fractions of real spheres) or as whole boxes stacked in layers, using Wikidata sizes or your own dimensions.
| Field | Type | Default | Description |
|---|---|---|---|
item | text | "Earth" | What to fit. An object from the list, or your own: “Box = 40 × 30 × 20 cm”, “Ball = ⌀ 22 cm” or “Rope = 12 m”. |
container | text | "Sun" | Where to fit it. Same choices as above, for example “Room = 5 × 4 × 2.5 m”. |
mode | select (volume, area, length, boxes) | "volume" | Count by |
packing | select (none, random, densest) | "none" | Gaps between round things |
keepUpright | boolean | false | Keep boxes upright. Whole boxes only: the third dimension stays vertical (pallets, fridges). |
Example request
Earths in the Sun
curl -X POST https://sizewisefitcount.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"item":"Earth","container":"Sun","mode":"volume","packing":"none"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://sizewisefitcount.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
sizewise_fit_count - Local stdio connector:
node src/mcp-stdio.ts --tool=sizewise-fit-count
{
"mcpServers": {
"sizewise-fit-count": { "type": "http", "url": "https://sizewisefitcount.usefulweb.app/mcp" }
}
}