API & MCP

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

HTTP API

Twinworks Buffer Allocation Optimiser

Solves the buffer allocation problem of a production line by simulation: a fixed total of buffer places (for example the floor space you have) is distributed over the buffers so that throughput is as high as possible. Greedy marginal allocation with common random numbers, compared against the current allocation with a paired confidence interval.

Inputs of Twinworks Buffer Allocation Optimiser
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
totalinteger—Total buffer places. Places to distribute over the buffers. Default: the sum of the current capacities (same space, better placement).
minCapacityinteger1Minimum per buffer
bufferstext—Buffer ids. Comma-separated ids (e.g. B1,B2,B3). Default: every buffer with a finite capacity.
replicationsinteger3Replications per candidate
horizonHoursnumber—Run length per replication. Overrides the model setting.

Example request

Bottleneck demo: 8 places over four buffers

curl -X POST https://twinworksbufferallocation.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"template":"bottleneck-buffer-sizing","total":8,"replications":3,"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-allocation": { "type": "http", "url": "https://twinworksbufferallocation.usefulweb.site/mcp" }
  }
}