API & MCP
Everything a person can do on Threadsmith Sequence Optimizer, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://threadsmithsequenceoptimizer.usefulweb.site/api/v1/calculate– run Threadsmith Sequence OptimizerGET https://threadsmithsequenceoptimizer.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Threadsmith Sequence Optimizer
Reads an embroidery machine file (or a stitch list), splits it into the segments that are sewn without a jump or trim, and finds a sewing order with fewer trims, jumps and colour changes: segments may be sewn backwards, colour blocks with the same thread are merged, and segments whose stitches overlap keep their original order so the layering does not change. Every stitch is kept. You get the before/after counts, the sewing time saved and the optimised file in the same or another format, decoded again to prove that every penetration is still there.
| Field | Type | Default | Description |
|---|---|---|---|
file | file | — | Embroidery file. Tajima .dst, Brother .pes, Janome .jef or Melco .exp. |
stitches | textarea | — | Or: stitch list (JSON). Same format as threadsmith-stitch-file. |
colors | list | — | Thread colours in sewing order. Optional #rrggbb per colour block. DST and EXP files store no colours, so blocks are only merged when you give their colours (PES/JEF colours are read from the file). |
outputFormat | select (same, dst, pes, jef, exp) | "same" | Write the optimised file as |
trimDistance | number | 5 | Trim gaps of at least. Shorter gaps are jumped without a trim. |
allowReverse | boolean | true | Allow sewing segments backwards |
mergeColors | boolean | true | Merge colour blocks with the same thread. Only blocks whose stitches do not overlap anything sewn in between are moved together. |
spm | integer | 700 | Machine speed |
label | text | "OPTIMIZED" | Design label (DST/PES header) |
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://threadsmithsequenceoptimizer.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
threadsmith_sequence_optimizer - Local stdio connector:
node src/mcp-stdio.ts --tool=threadsmith-sequence-optimizer
{
"mcpServers": {
"threadsmith-sequence-optimizer": { "type": "http", "url": "https://threadsmithsequenceoptimizer.usefulweb.site/mcp" }
}
}