API & MCP
Everything a person can do on Twinworks Queueing Check, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://twinworksqueueformulas.usefulweb.site/api/v1/calculate– run Twinworks Queueing CheckGET https://twinworksqueueformulas.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Twinworks Queueing Check
Closed-form queueing results for a single workstation: utilization, mean waiting time, queue length and time in system for M/M/1, M/M/c (Erlang C), M/D/1, M/G/1 (Pollaczek–Khinchine) and the Kingman G/G/1 approximation. Optionally runs the Twinworks simulation of the same station and reports whether the theory lies inside the simulated confidence interval.
| Field | Type | Default | Description |
|---|---|---|---|
queue | select (mm1, mmc, md1, mg1, gg1) | "mm1" | Queue model |
arrivalsPerHour (required) | number | 60 | Arrival rate |
serviceTime (required) | number | 48 | Mean service (cycle) time |
servers | integer | 2 | Servers (M/M/c) |
serviceScv | number | 1 | Service SCV (variance ÷ mean²) |
arrivalScv | number | 1 | Inter-arrival SCV (G/G/1) |
verify | boolean | false | Verify by simulation. Runs the same station in Twinworks (M/M/1, M/M/c, M/D/1 only). |
replications | integer | 10 | Replications for the check |
Example request
M/M/1 at 80 % utilization, verified by simulation
curl -X POST https://twinworksqueueformulas.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"queue":"mm1","arrivalsPerHour":60,"serviceTime":48,"verify":true,"replications":10}'
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://twinworksqueueformulas.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
twinworks_queue_formulas - Local stdio connector:
node src/mcp-stdio.ts --tool=twinworks-queue-formulas
{
"mcpServers": {
"twinworks-queue-formulas": { "type": "http", "url": "https://twinworksqueueformulas.usefulweb.site/mcp" }
}
}