Skip to main content
Glama

CutOptim Engine

Nest true shapes

optimize_nest

Metered: one Engine API call (needs an API key; not available with the demo key). Nest free-form polygon parts on sheets. True-shape (irregular / polygon) nesting. Pack ARBITRARY POLYGONS onto fixed sheets, letting parts interlock into each other's concave pockets — an L-bracket, a gasket, a laser-cut profile. This is a different class from the rectangular modes: a part is an outline (polygon, optional interior holes), not a width×height, so a bounding-box packer's notch-air is reclaimed. On a representative 272-part job it uses 6 sheets where the same parts by bounding box need 9 (−33 % material).

Two things the rectangular API cannot express come for free here: per-sheet EXCLUSION ZONES (stock[].exclusions — a defect, a clamp footprint, a pre-printed area; a quality-0 zone is a no-go region for any part), and true-shape holes. Material partition (material) and the opaque meta passthrough work exactly as on the other modes.

⚠️ density is the placed POLYGON area over used sheet area — the honest fill, with concave pockets counted as empty. It is NOT comparable to a rectangular packer's yieldPct (which counts each bounding box as solid and so reads higher for a worse result); the cross-comparable metric is sheetCount on the same parts.

A placed part carries the rigid transform (rotation in degrees, then x/y translation), NOT a re-emitted polygon: your input outline plus that transform reconstructs the placement exactly. Deterministic (a pinned seed); set options.seed to reproduce a layout.

Engines: lbf (default) is synchronous and instant. Besides its own pass it tries the parts restricted to the right angles they allow, and their bounding boxes packed by an exact rectangle packer — which finds grids a sampling search misses (three 500-wide parts on a 1500-wide sheet at zero spacing) — and keeps whichever ranks best; on a tie, the plan that fills its sheets front to back, then the one with fewer parts off the right angles. max is ASYNCHRONOUS: the call answers 202 with a jobId, and you poll GET /v1/jobs/{id} for the result — the same response shape, with engine: "max". It runs the lbf pass first and then a time-budgeted search (options.timeBudgetMs, default 60 s, 10–180 s) that fills sheets one at a time looking for a layout with FEWER sheets; it never returns more sheets than lbf would — nor a plan that ranks worse by the sheet-size ranking below — and says in warnings when it kept the lbf layout. Several sheet sizes per material and respectStock are modelled; a polygon sheet or exclusions (which its strip search cannot model) are served by the lbf pass inside the job, with a warning — never refused. sparrow is a deprecated alias of max.

Sheet sizes and cost. With two or more stock rows for a material, both engines compare arrangements (your order, each row alone, cheapest-first) and then re-nest each sheet — the least-filled first — onto the cheaper or smaller rows, so a plan may MIX sizes (e.g. two large sheets and a small last one). Ranking: most must-cut (priority) parts placed → most parts placed → (with minimizeCost) lowest total price → least total sheet area → fewest sheets. sheets[].stock and stockUsage[] say which row each sheet came from. Used area. sheets[].usedWidth / usedHeight are the farthest extent of any placed part from the sheet origin (the corner the parts are packed into), usedArea their product, and stockUsage[].usedArea the sum per row — the numbers an ERP needs to charge a partial sheet (full sheet, a horizontal or vertical cut, or the bounding box; the charging rule stays yours). Both engines compact the least-filled sheet of each material: its parts are re-nested on the same sheet with rotation SUBSETS of what each part allows ({0,180}, {0,90,180,270}, a single orientation — never a new angle) and the variant with the smallest used area is kept; with max that sheet is then also re-packed by the search itself, along the sheet's height and (on a one-sheet plan) along its width, and the tighter layout is kept under the same rule. Sheet count, sizes, price and placed parts never change. options.compact: false returns the uncompacted layout, and options.compactFor (box · horizontal · vertical) picks the measure to minimise when you charge a full-width or full-height strip. metrics.cutLength / sheets[].cutLength is the summed perimeter of the placed parts' outlines and holes; pierces counts one per closed contour (no common-line cutting, lead-ins or micro-joints — your CAM adds those).

Parts from CAD files. A part may carry source — an SVG or DXF document — instead of polygon coordinates; the server reads the outline (and its holes) out of the file with the same parser the CutOptim app uses. The file replaces ONLY the geometry, and the response then carries an imported block saying what the files contributed. One file describes ONE part; POST /v1/import/nest splits a multi-part drawing first. Nothing is stored: the bytes are parsed in memory and gone with the response. Because a drawing is far larger than a JSON parts list, this path accepts a 10 MB body (the rectangular endpoints keep 1 MB), with per-file and per-request character caps on source.content.

Input Schema

NameRequiredDescriptionDefault
partsYesOne or more parts to nest, one NestPart per row.
stockYesOne or more sheet types, one NestStock per row.
engineNo`lbf` (default) is single-pass, synchronous and instant. `max` is ASYNCHRONOUS: 202 + poll `GET /v1/jobs/{id}`; it runs `lbf` first, then a time-budgeted search that fills sheets one at a time looking for FEWER sheets, and never returns more than `lbf`, nor a plan that ranks worse (price with `minimizeCost`, otherwise sheet area). It accepts several sheet sizes per material and `respectStock`; a `polygon` sheet or exclusion zones are served by `lbf` inside the job, with a warning. `sparrow` is a deprecated alias of `max`.lbf
includeNoAdditive inline export of the achieved layout. `svg` returns a self-contained, styled `<svg>` string (one titled band per sheet, parts drawn as filled polygons with holes, exclusion zones hatched); `dxf` returns an R12 document (closed `POLYLINE`/`VERTEX` outlines on STOCK/PARTS/HOLES/ZONES layers, part names on LABELS). Both are unit-agnostic, exactly like the request coordinates. The geometry in `sheets[]` is returned either way.
optionsNoSolve options. All optional.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, it discloses metering and API-key requirements, synchronous versus asynchronous job behavior with 202/polling, deterministic seeding, source-file non-persistence, body-size limits, warning behavior, and incomparability of `density` with rectangular `yieldPct`. These are exactly the behavioral traits an agent needs before invoking a complex remote optimization tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The critical purpose, metering warning, and engine distinction are front-loaded, and the long text is organized around clear themes. However, it is extremely verbose for a tool description and includes output-metric and implementation detail that could be trimmed without hurting invocation correctness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, full input schema, output schema, and annotations, the description is complete enough to call correctly. It covers authentication, async job flow, file import, stock modeling, compaction, warnings, and return-metric caveats.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents every parameter in detail. The description still adds cross-parameter meaning — engine behavior, polling, source-file handling, exclusion zones, ranking rules, compaction semantics, and the distinction between `density` and `sheetCount` — though some of this repeats schema wording rather than adding new parameter guidance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description immediately states a specific verb and resource: nesting free-form polygon parts on sheets, with true-shape/irregular nesting. It explicitly contrasts this with rectangular modes, so an agent can distinguish it from rectangular nesting siblings without reading the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explains when to use this tool versus rectangular modes, when to use `polygon` versus `source`, and when to choose `lbf` versus asynchronous `max`. It also names exclusions and constraints such as API-key requirements, demo-key limitations, and cases where `max` falls back to `lbf` with warnings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.