API & MCP
Everything a person can do on Twinworks Line Balancing, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://twinworkslinebalance.usefulweb.site/api/v1/calculate– run Twinworks Line BalancingGET https://twinworkslinebalance.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Twinworks Line Balancing
Solves the simple assembly line balancing problem (type 1) with the Ranked Positional Weight (Helgeson–Birnie) and Largest Candidate rules: tasks with times and precedence relations are assigned to as few stations as possible without exceeding the takt time. Returns the station assignment, line efficiency, balance delay, smoothness index and a ready-to-simulate Twinworks model of the balanced line.
| Field | Type | Default | Description |
|---|---|---|---|
tasks (required) | table | — | Tasks |
taktTime | number | — | Takt time. Leave empty to compute it from available time ÷ demand. |
availableMinutes | number | — | Available production time. Per period, e.g. 450 min per shift. |
demand | number | — | Demand in that period |
method | select (best, rpw, lcr) | "best" | Heuristic |
Example request
Wheelbarrow-style example: 8 tasks, 450 min shift, demand 270
curl -X POST https://twinworkslinebalance.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"tasks":[{"id":"A","name":"Fit frame","time":60,"predecessors":""},{"id":"B","name":"Mount axle","time":40,"predecessors":"A"},{"id":"C","name":"Fit wheel","time":55,"predecessors":"B"},{"id":"D","name":"Attach tray","time":50,"predecessors":"A"},{"id":"E","name":"Fit legs","time":30,"predecessors":"D"},{"id":"F","name":"Attach handles","time":45,"predecessors":"D"},{"id":"G","name":"Grips","time":20,"predecessors":"F"},{"id":"H","name":"Final check","time":35,"predecessors":"C,E,G"}],"availableMinutes":450,"demand":270,"method":"best"}'
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://twinworkslinebalance.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
twinworks_line_balance - Local stdio connector:
node src/mcp-stdio.ts --tool=twinworks-line-balance
{
"mcpServers": {
"twinworks-line-balance": { "type": "http", "url": "https://twinworkslinebalance.usefulweb.site/mcp" }
}
}