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 Check
  • GET https://twinworksqueueformulas.usefulweb.site/api/v1/tool – inputs, output schema, examples
  • OpenAPI 3.1: /openapi.json · /openapi.yaml
  • Errors: application/problem+json; 422 includes per-field errors.

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.

Inputs of Twinworks Queueing Check
FieldTypeDefaultDescription
queueselect (mm1, mmc, md1, mg1, gg1)"mm1"Queue model
arrivalsPerHour (required)number60Arrival rate
serviceTime (required)number48Mean service (cycle) time
serversinteger2Servers (M/M/c)
serviceScvnumber1Service SCV (variance ÷ mean²)
arrivalScvnumber1Inter-arrival SCV (G/G/1)
verifybooleanfalseVerify by simulation. Runs the same station in Twinworks (M/M/1, M/M/c, M/D/1 only).
replicationsinteger10Replications 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" }
  }
}