API & MCP

Everything a person can do on Twinworks Buffer & Parameter Sweep, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Twinworks Buffer & Parameter Sweep

Runs a Twinworks factory model repeatedly while one parameter changes — typically the capacity of a buffer from 1 to 10 places, but also servers, cycle times, MTTR, batch sizes, conveyor speed or the number of operators. Returns throughput, lead time and WIP per value with confidence intervals, plus the knee point where extra capacity stops paying off.

Inputs of Twinworks Buffer & Parameter Sweep
FieldTypeDefaultDescription
modeltextarea—Model or project JSON. A Twinworks project (.twinworks.json, format "twinworks-project") or a bare model with "nodes" and "links". Times in seconds, lengths in metres. Leave empty and pick a template instead.
templateselect (, three-station-line, line-with-failures, assembly-two-feeders, job-shop-routings, bottleneck-buffer-sizing, conveyor-packaging, mm1-validation, shared-forklifts, plc-control)—Or start from a template
targettext—Object id. Id of the buffer/machine/conveyor/source to change, or pool:<id> for an operator pool. Default for the bottleneck template: B2.
parameterselect (capacity, servers, cycle.value, cycle.mean, batchSize, interval.mean, interval.value, speed, length, failure.mttr.mean, failure.mtbf.mean, setup.value, scrapPct, count)"capacity"Parameter
fromnumber1From
tonumber10To
stepnumber1Step
replicationsinteger4Replications per value
horizonHoursnumber—Run length per replication. Overrides the model setting.

Example request

Bottleneck demo: buffer B2 from 1 to 10

curl -X POST https://twinworksbuffersweep.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"template":"bottleneck-buffer-sizing","target":"B2","parameter":"capacity","from":1,"to":10,"step":1,"replications":4,"horizonHours":6}'

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)

{
  "mcpServers": {
    "twinworks-buffer-sweep": { "type": "http", "url": "https://twinworksbuffersweep.usefulweb.site/mcp" }
  }
}