{
  "notice": "bxzxxr MCP archive: a record of what public MCP servers declared when we listed them (we never call their tools). It is data, not a rating: nothing here says a server is safe, secure, verified or trustworthy, and a server can change after we looked. Secrets we detected are redacted; redacted tool lists are withheld and only their hash is shown.",
  "infrastructure": {
    "host": "api.cutoptim.com",
    "site": "cutoptim.com",
    "addresses": [
      {
        "address": "49.12.201.147",
        "endpoints": 1,
        "shared_infrastructure": false,
        "network": {
          "asn": 24940,
          "name": "HETZNER-AS - Hetzner Online GmbH",
          "prefix": "49.12.0.0/16",
          "country": "DE"
        }
      }
    ],
    "addresses_recorded": true,
    "address_history": [
      {
        "addresses": [
          "49.12.201.147"
        ],
        "first_seen": "2026-11-21T15:14:01.873Z",
        "last_seen": "2026-11-21T15:14:01.873Z",
        "checks": 1
      }
    ],
    "hosting": [],
    "software": [],
    "server_info": {
      "name": "cutoptim",
      "version": "1.0.0+d16b3076",
      "protocol_version": "2025-06-18"
    },
    "headers": {
      "strict-transport-security": "max-age=31536000; includeSubDomains; preload"
    },
    "auth": null
  },
  "related": {
    "same_address": {
      "total": 0,
      "sample": []
    },
    "same_site": {
      "total": 0,
      "sample": []
    },
    "same_tool_list": {
      "total": 0,
      "sample": []
    },
    "same_publisher": {
      "publisher": "io.github.cutoptim",
      "total": 0,
      "sample": []
    },
    "same_repository": {
      "repository_url": "https://github.com/cutoptim/engine-mcp",
      "total": 0,
      "sample": []
    },
    "note": "Shared addresses on big platforms (Cloudflare, Vercel and the like) put unrelated servers together; those are marked shared_infrastructure. A match is a pivot, not a link between operators."
  },
  "endpoint": {
    "id": "28566",
    "server_name": "io.github.cutoptim/engine",
    "url": "https://api.cutoptim.com/mcp",
    "host": "api.cutoptim.com",
    "transport": "streamable-http",
    "last_checked_at": "2026-11-21T15:14:01.873Z",
    "last_state": "listed",
    "last_detail": null,
    "consecutive_failures": 0,
    "current_sha": "1187b89d606aeba76272d753cdeeee570b68923acb38d79a4d91da3bff22efca",
    "first_listed_at": "2026-11-21T15:14:01.873Z",
    "created_at": "2026-11-21T09:30:13.036Z",
    "resolved_addresses": [
      "49.12.201.147"
    ]
  },
  "server": {
    "name": "io.github.cutoptim/engine",
    "title": "CutOptim Engine",
    "description": "Cutting optimization: 2D panels, 1D bars, timber and true-shape nesting via the CutOptim API.",
    "version": "0.1.3",
    "registry_status": "active",
    "repository_url": "https://github.com/cutoptim/engine-mcp",
    "website_url": "https://cutoptim.com/engine/reference/guides/mcp",
    "published_at": "2026-11-18T23:53:05.087Z",
    "updated_at": "2026-11-18T23:53:05.087Z",
    "first_seen": "2026-11-21T09:30:12.493Z"
  },
  "other_endpoints": [],
  "intel": {
    "capabilities": [],
    "evm_addresses": [],
    "chains": [],
    "tokens": [],
    "computed_at": "2026-11-22T15:44:09.865Z"
  },
  "operator": null,
  "needs_sign_in": false,
  "reachability": {
    "window_days": 30,
    "checks": 1,
    "answered": 1,
    "answered_percent": 100,
    "avg_listing_latency_ms": 944,
    "first_check_in_window": "2026-11-21T15:14:01.873Z",
    "consecutive_failures_now": 0,
    "days": [
      {
        "day": "2026-11-21",
        "checks": 1,
        "answered": 1,
        "last_state": "listed"
      }
    ]
  },
  "tool_list": {
    "sha256": "1187b89d606aeba76272d753cdeeee570b68923acb38d79a4d91da3bff22efca",
    "tools": 10,
    "resources": 0,
    "prompts": 0,
    "first_seen": "2026-11-21T15:14:02.820Z",
    "tool_names": [
      "optimize_2d",
      "optimize_1d",
      "optimize_wood",
      "optimize_nest",
      "validate_2d",
      "validate_1d",
      "validate_wood",
      "validate_nest",
      "get_job",
      "get_usage"
    ],
    "declared": {
      "tools": [
        {
          "name": "optimize_2d",
          "title": "Optimize 2D panels",
          "description": "Metered: one Engine API call. Cut rectangular parts from sheets (panels, plywood, glass, sheet metal) and get the layout, cut plan and yield. 2D panel optimization. Nest rectangular parts into rectangular sheets. Returns the placement of every part, the remaining offcuts, the guillotine cut plan and the yield metrics. Parts named in `matchedSets` (grain matching) are cut side by side from one piece of board, one kerf apart; each placed member says which set and position it is.",
          "inputSchema": {
            "truncated": true,
            "chars": 25419
          },
          "outputSchema": {
            "type": "object",
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "engine",
                  "engineVersion",
                  "contractVersion",
                  "deterministic",
                  "sheets",
                  "metrics",
                  "unplaced",
                  "warnings",
                  "guillotineValid",
                  "timing"
                ],
                "properties": {
                  "csv": {
                    "type": "string"
                  },
                  "dxf": {
                    "type": "string"
                  },
                  "pdf": {
                    "type": "string",
                    "format": "byte"
                  },
                  "svg": {
                    "type": "string"
                  },
                  "engine": {
                    "enum": [
                      "heuristic",
                      "balanced",
                      "max"
                    ],
                    "type": "string"
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "sheet",
                        "name",
                        "partNo",
                        "w",
                        "h",
                        "rotated",
                        "x",
                        "y"
                      ],
                      "properties": {
                        "h": {
                          "type": "number"
                        },
                        "w": {
                          "type": "number"
                        },
                        "x": {
                          "type": "number"
                        },
                        "y": {
                          "type": "number"
                        },
                        "of": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "qr": {
                          "type": "string"
                        },
                        "meta": {
                          "type": "object"
                        },
                        "name": {
                          "type": "string"
                        },
                        "edges": {
                          "type": "object",
                          "properties": {
                            "top": {
                              "type": "object",
                              "required": [
                                "reference",
                                "length"
                              ],
                              "properties": {
                                "length": {
                                  "type": "number"
                                },
                                "reference": {
                                  "type": "string"
                                }
                              }
                            },
                            "left": {
                              "type": "object",
                              "required": [
                                "reference",
                                "length"
                              ],
                              "properties": {
                                "length": {
                                  "type": "number"
                                },
                                "reference": {
                                  "type": "string"
                                }
                              }
                            },
                            "right": {
                              "type": "object",
                              "required": [
                                "reference",
                                "length"
                              ],
                              "properties": {
                                "length": {
                                  "type": "number"
                                },
                                "reference": {
                                  "type": "string"
                                }
                              }
                            },
                            "bottom": {
                              "type": "object",
                              "required": [
                                "reference",
                                "length"
                              ],
                              "properties": {
                                "length": {
                                  "type": "number"
                                },
                                "reference": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "grain": {
                          "enum": [
                            "w",
                            "h"
                          ],
                          "type": "string"
                        },
                        "piece": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "sheet": {
                          "type": "integer"
                        },
                        "partNo": {
                          "type": "integer"
                        },
                        "rotated": {
                          "type": "boolean"
                        },
                        "sheetNo": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "material": {
                          "type": "string"
                        },
                        "stockRow": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sheetMeta": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "sheets": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "w",
                        "h",
                        "price",
                        "parts"
                      ],
                      "properties": {
                        "h": {
                          "type": "number"
                        },
                        "w": {
                          "type": "number"
                        },
                        "meta": {
                          "type": "object"
                        },
                        "grain": {
                          "enum": [
                            "w",
                            "h"
                          ],
                          "type": "string"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "x",
                              "y",
                              "w",
                              "h",
                              "rotated"
                            ],
                            "properties": {
                              "h": {
                                "type": "number"
                              },
                              "w": {
                                "type": "number"
                              },
                              "x": {
                                "type": "number"
                              },
                              "y": {
                                "type": "number"
                              },
                              "meta": {
                                "type": "object"
                              },
                              "name": {
                                "type": "string"
                              },
                              "rotated": {
                                "type": "boolean"
                              },
                              "matchedSet": {
                                "type": "object",
                                "required": [
                                  "id",
                                  "instance",
                                  "position"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "hint": {
                                    "enum": [
                                      "left",
                                      "middle",
                                      "right",
                                      "top",
                                      "bottom"
                                    ],
                                    "type": "string"
                                  },
                                  "instance": {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  "position": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                }
                              }
                            }
                          }
                        },
                        "price": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "offcuts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "x",
                              "y",
                              "w",
                              "h"
                            ],
                            "properties": {
                              "h": {
                                "type": "number"
                              },
                              "w": {
                                "type": "number"
                              },
                              "x": {
                                "type": "number"
                              },
                              "y": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "material": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "timing": {
                    "type": "object",
                    "required": [
                      "solveMs"
                    ],
                    "properties": {
                      "solveMs": {
                        "type": "number"
                      }
                    }
                  },
                  "cutPlan": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "required": [
                        "sheet",
                        "step",
                        "axis",
                        "pos",
                        "length",
                        "stage"
                      ],
                      "properties": {
                        "pos": {
                          "type": "number"
                        },
                        "axis": {
                          "enum": [
                            "h",
                            "v"
                          ],
                          "type": "string"
                        },
                        "step": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "angle": {
                          "type": "number"
                        },
                        "bevel": {
                          "type": "number"
                        },
                        "sheet": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "stage": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "length": {
                          "type": "number",
                          "minimum": 0
                        }
                      }
                    }
                  },
                  "metrics": {
                    "type": "object",
                    "required": [
                      "sheetCount",
                      "yieldPct",
                      "placed",
                      "total",
                      "cutLines",
                      "sawPasses",
                      "cutLength",
                      "totalPrice"
                    ],
                    "properties": {
                      "total": {
                        "type": "integer"
                      },
                      "placed": {
                        "type": "integer"
                      },
                      "cutLines": {
                        "type": "integer"
                      },
                      "yieldPct": {
                        "type": "number"
                      },
                      "cutLength": {
                        "type": "number"
                      },
                      "sawPasses": {
                        "type": "integer"
                      },
                      "sheetCount": {
                        "type": "integer"
                      },
                      "totalPrice": {
                        "type": "number"
                      }
                    }
                  },
                  "planHash": {
                    "type": "string"
                  },
                  "unplaced": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "w",
                        "h",
                        "qty"
                      ],
                      "properties": {
                        "h": {
                          "type": "number"
                        },
                        "w": {
                          "type": "number"
                        },
                        "qty": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "warnings": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "labelsPdf": {
                    "type": "string",
                    "format": "byte"
                  },
                  "materials": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "material",
                        "sheetCount",
                        "yieldPct",
                        "placed",
                        "total",
                        "totalPrice"
                      ],
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "placed": {
                          "type": "integer"
                        },
                        "material": {
                          "type": "string"
                        },
                        "yieldPct": {
                          "type": "number"
                        },
                        "sheetCount": {
                          "type": "integer"
                        },
                        "totalPrice": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "edgeBanding": {
                    "type": "object",
                    "required": [
                      "totalMeters",
                      "byType",
                      "byPart"
                    ],
                    "properties": {
                      "byPart": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "name",
                            "meters",
                            "byType"
                          ],
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "byType": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "reference",
                                  "meters"
                                ],
                                "properties": {
                                  "meters": {
                                    "type": "number"
                                  },
                                  "reference": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "meters": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "byType": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "reference",
                            "meters"
                          ],
                          "properties": {
                            "meters": {
                              "type": "number"
                            },
                            "reference": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "totalMeters": {
                        "type": "number"
                      }
                    }
                  },
                  "matchedSets": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "letter",
                        "requested",
                        "asBlock",
                        "split",
                        "unplaced",
                        "block",
                        "warnings"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "block": {
                          "type": "object",
                          "required": [
                            "w",
                            "h"
                          ],
                          "properties": {
                            "h": {
                              "type": "number"
                            },
                            "w": {
                              "type": "number"
                            }
                          }
                        },
                        "split": {
                          "type": "integer"
                        },
                        "letter": {
                          "type": "string"
                        },
                        "asBlock": {
                          "type": "integer"
                        },
                        "unplaced": {
                          "type": "integer"
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "requested": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "deterministic": {
                    "type": "boolean",
                    "const": true
                  },
                  "engineVersion": {
                    "type": "string"
                  },
                  "contractVersion": {
                    "type": "string"
                  },
                  "guillotineValid": {
                    "type": "boolean"
                  },
                  "unmatchedMaterials": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "material",
                        "parts"
                      ],
                      "properties": {
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "w",
                              "h",
                              "qty"
                            ],
                            "properties": {
                              "h": {
                                "type": "number"
                              },
                              "w": {
                                "type": "number"
                              },
                              "qty": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "material": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "jobId",
                  "status",
                  "mode",
                  "engine",
                  "pollAfterMs"
                ],
                "properties": {
                  "mode": {
                    "enum": [
                      "2d"
                    ],
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "quota": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer"
                      },
                      "limit": {
                        "type": "integer"
                      },
                      "reserved": {
                        "type": "integer"
                      }
                    }
                  },
                  "engine": {
                    "enum": [
                      "max",
                      "heuristic",
                      "balanced"
                    ],
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "queued",
                      "running"
                    ],
                    "type": "string"
                  },
                  "pollAfterMs": {
                    "type": "integer"
                  }
                }
              }
            ]
          },
          "annotations": {
            "title": "Optimize 2D panels",
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "optimize_1d",
          "title": "Optimize 1D bars",
          "description": "Metered: one Engine API call. Cut lengths from bars, tubes, profiles or rolls and get the cutting pattern per bar. 1D / linear optimization (bars, profiles, tube). Cut parts of a given length from stock bars. Returns the rods used, the position of every part along each rod, the leftover length and the yield metrics.",
          "inputSchema": {
            "type": "object",
            "required": [
              "parts",
              "stock"
            ],
            "properties": {
              "async": {
                "enum": [
                  "auto"
                ],
                "type": "string",
                "description": "Opt in to answers that may arrive later. With `\"auto\"` a job that finishes within the synchronous time limit still answers 200 with the plan, exactly as without it; a job that would outgrow the limit answers **202** with a `jobId` instead, keeps solving, and its plan is read with `GET /v1/jobs/{id}` (the same poll as engine `max`). The call is billed once, when the plan is written; a solve that fails is not billed. Without this field such a job answers 504 `solve_timeout` with the `jobId` in `details` and is not charged. The official SDKs send it and wait for the job for you."
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "length"
                  ],
                  "properties": {
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1,
                      "description": "How many copies. The sum across all rows must not exceed 2000."
                    },
                    "ends": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "object",
                          "required": [
                            "angle"
                          ],
                          "properties": {
                            "angle": {
                              "type": "number",
                              "description": "The face angle: the mitre or plumb cut as seen on the `depth` side (wood: on `sh` as entered).",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            },
                            "bevel": {
                              "type": "number",
                              "default": 0,
                              "description": "The edge angle: the bevel as seen on the `thickness` side (wood: on `sw` as entered). A compound cut has both.",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            }
                          },
                          "description": "One end cut of a part, in degrees from square (0 = a square end), signed. The part is measured long point to long point (`length` is its overall length). A part whose two end cuts would cross inside its section (shorter than its leads) cannot be made: a 400 `invalid_request` naming `parts[i].ends` says how long it must at least be."
                        },
                        "start": {
                          "type": "object",
                          "required": [
                            "angle"
                          ],
                          "properties": {
                            "angle": {
                              "type": "number",
                              "description": "The face angle: the mitre or plumb cut as seen on the `depth` side (wood: on `sh` as entered).",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            },
                            "bevel": {
                              "type": "number",
                              "default": 0,
                              "description": "The edge angle: the bevel as seen on the `thickness` side (wood: on `sw` as entered). A compound cut has both.",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            }
                          },
                          "description": "One end cut of a part, in degrees from square (0 = a square end), signed. The part is measured long point to long point (`length` is its overall length). A part whose two end cuts would cross inside its section (shorter than its leads) cannot be made: a 400 `invalid_request` naming `parts[i].ends` says how long it must at least be."
                        }
                      },
                      "description": "The angled ends of a part, read only with `options.mitrePairing`. Two parts of one section whose facing ends lie in one plane (after a turn `flip` allows) can be cut with ONE saw cut between them: the triangle between the long and the short point is not wasted. Without `mitrePairing` the ends are not used (a warning says so) and the part packs as its `length`."
                    },
                    "flip": {
                      "enum": [
                        "none",
                        "face",
                        "edge",
                        "any"
                      ],
                      "type": "string",
                      "default": "none",
                      "description": "Mitre pairing only: which 180° turns of the part on the bar are allowed, so its angled end can meet a neighbour's. `none` (default — a profiled moulding or one-sided stock), `face` (end for end, the crown or top edge stays up — roof members), `edge` (end for end over the edge — flat stock, frames), `any`."
                    },
                    "meta": {
                      "type": "object",
                      "description": "Opaque JSON object (any keys) echoed back VERBATIM on the matching output (a part's meta on every placed piece of it; a stock row's meta on every sheet/rod cut from it). Attach ERP article numbers, order-line ids, customer refs to reconcile the cut plan with your system. Never parsed, never affects placement. Part meta follows its request row: the meta of each row lands on exactly its qty of placed pieces, even when rows share a name; stock meta by stock-row order."
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "Optional label. Defaults to `Part <1-based row index>`."
                    },
                    "depth": {
                      "type": "number",
                      "description": "Mitre pairing only: the side of the bar the `angle` of `ends` is seen on. Required with `ends` (a 1D part has no cross-section to take it from). Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "length": {
                      "type": "number",
                      "description": "Cut length. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "Material identity — a HARD placement constraint. A part of material X is cut ONLY from stock of material X (unlike `edgeBanding`, this changes the layout). Free string, library-independent: send your own ERP code. Absent = the \"unspecified\" partition (matches only material-less stock). With no part or stock carrying `material`, the whole solve is byte-identical to before."
                    },
                    "priority": {
                      "type": "boolean",
                      "description": "Must-cut; wins stock when `options.respectStock` caps it."
                    },
                    "thickness": {
                      "type": "number",
                      "description": "Mitre pairing only: the other side, the one the `bevel` is seen on. Required with `ends`. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    }
                  },
                  "description": "A linear part. There is no `rotatable` or `grainGroup` in 1D."
                },
                "minItems": 1,
                "description": "The lengths to cut, one row per part type (`length`, optional `qty`, `name`, mitred `ends`)."
              },
              "stock": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "length"
                  ],
                  "properties": {
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1,
                      "description": "Bars available. A hard cap only with `options.respectStock`."
                    },
                    "meta": {
                      "type": "object",
                      "description": "Opaque JSON object (any keys) echoed back VERBATIM on the matching output (a part's meta on every placed piece of it; a stock row's meta on every sheet/rod cut from it). Attach ERP article numbers, order-line ids, customer refs to reconcile the cut plan with your system. Never parsed, never affects placement. Part meta follows its request row: the meta of each row lands on exactly its qty of placed pieces, even when rows share a name; stock meta by stock-row order."
                    },
                    "price": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Price per bar."
                    },
                    "length": {
                      "type": "number",
                      "description": "Bar length. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "A stock unit of material X serves only material-X parts. Free string; see the part `material`."
                    },
                    "priority": {
                      "type": "boolean",
                      "description": "\"Use this stock up first\" — a soft preference ranked BELOW sheet/rod count. Steers which format is spent first without spending more of it."
                    }
                  }
                },
                "maxItems": 50,
                "minItems": 1,
                "description": "The bar lengths to cut from, one row per length (`length`, optional `qty`, `price`)."
              },
              "engine": {
                "enum": [
                  "heuristic",
                  "balanced"
                ],
                "type": "string",
                "default": "heuristic",
                "description": "`max` is not offered here: it is a 2D (and, separately, nesting) tier, and `engine: \"max\"` on this path is a **400** before a call is charged. In 1D `balanced` resolves to the same packer as `heuristic` — the linear packer is already a best-of-multiple-strategies search, so there is no separate balanced mode. The value is accepted and echoed back so a single client can send one engine id for both endpoints."
              },
              "include": {
                "type": "array",
                "items": {
                  "enum": [
                    "cutPlan",
                    "offcuts",
                    "svg",
                    "csv",
                    "dxf",
                    "labels",
                    "planHash",
                    "pdf",
                    "labelsPdf"
                  ],
                  "type": "string"
                },
                "description": "Three kinds of token. NARROWING (`cutPlan`, `offcuts`): omit the field entirely to get both; a present array keeps only the narrowing tokens it lists (an empty array drops both). ADDITIVE EXPORT (`svg`, `csv`, `dxf`): each adds an inline export STRING to the response (`svg` a standalone 2D layout — 2D only, a warning is returned for 1D/wood; `dxf` an R12/AC1009 drawing; `csv` a cut list, RFC 4180 quoted (a part name with a comma or a quote stays one field) and formula-injection-guarded (a name beginning with `=`, `+`, `-`, `@`, TAB or CR is prefixed with an apostrophe so a spreadsheet reads it as text, not a formula — CWE-1236). 2D DATA (`labels`, `planHash`, `pdf`, `labelsPdf`): `labels` adds per-piece label data (`labels[]`, see `Label2D`), `planHash` a 64-hex fingerprint of the plan (the same plan always gives the same hash), `pdf` the cutting-plan PDF and `labelsPdf` the label PDF, both base64-encoded and drawn by the same code as the CutOptim app. These four are 2D only: a 1D or wood request returns a `warnings` entry instead. `pdf` renders at most 500 parts (total quantity); a larger 2D request with `pdf` is a 413 `too_large` with `details.path: \"include\"`. Export and data tokens do not affect narrowing, so `[\"svg\"]` adds svg and — listing no narrowing token — drops cutPlan/offcuts; use `[\"cutPlan\",\"offcuts\",\"svg\"]` to keep everything."
              },
              "options": {
                "type": "object",
                "properties": {
                  "kerf": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0,
                    "description": "Blade width. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side."
                  },
                  "trim": {
                    "type": "object",
                    "properties": {
                      "end": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side."
                      },
                      "start": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side."
                      }
                    },
                    "description": "A bar has two ends, not four edges. `start` is the leading trim (it shifts the first part along the bar, so the first `pos` equals `start`); `end` is the trailing trim."
                  },
                  "minOffcut": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0,
                    "description": "Output filter: report a leftover only if it is at least this long."
                  },
                  "tolerance": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0,
                    "description": "Accept cuts overshooting by up to this much. Pieces that only fitted thanks to it are counted in `metrics.toleranceAcceptedCount` and noted in `warnings`."
                  },
                  "minimizeCost": {
                    "type": "boolean",
                    "default": false,
                    "description": "Rank by total bar price."
                  },
                  "mitrePairing": {
                    "type": "boolean",
                    "default": false,
                    "description": "Pair parts of one section whose facing ends (`parts[].ends`) can share ONE saw cut. Off by default: a request without it is solved exactly as before. On, a plan with pairs is returned only when it ranks strictly better than the unpaired plan by the packer's own ranking (parts placed first, then material — or price with `minimizeCost`); otherwise the unpaired plan comes back. Pairs only, no chains of three or more."
                  },
                  "respectStock": {
                    "type": "boolean",
                    "default": false,
                    "description": "Treat `qty` as a hard cap."
                  }
                },
                "description": "The 1D option set is deliberately smaller: there is no `firstCut`, `maxCutStages` or `minimizeRotations`, because none of them means anything on a bar."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "engine",
                  "engineVersion",
                  "contractVersion",
                  "deterministic",
                  "rods",
                  "metrics",
                  "unplaced",
                  "warnings",
                  "timing"
                ],
                "properties": {
                  "csv": {
                    "type": "string"
                  },
                  "dxf": {
                    "type": "string"
                  },
                  "rods": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "length",
                        "price",
                        "remaining",
                        "parts"
                      ],
                      "properties": {
                        "meta": {
                          "type": "object"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "pos",
                              "length"
                            ],
                            "properties": {
                              "pos": {
                                "type": "number"
                              },
                              "meta": {
                                "type": "object"
                              },
                              "name": {
                                "type": "string"
                              },
                              "length": {
                                "type": "number"
                              },
                              "flipped": {
                                "enum": [
                                  "face",
                                  "edge",
                                  "roll"
                                ],
                                "type": "string"
                              },
                              "sharedCut": {
                                "type": "object",
                                "required": [
                                  "angle",
                                  "bevel",
                                  "kerfAlongAxis",
                                  "lead"
                                ],
                                "properties": {
                                  "lead": {
                                    "type": "number"
                                  },
                                  "angle": {
                                    "type": "number"
                                  },
                                  "bevel": {
                                    "type": "number"
                                  },
                                  "kerfAlongAxis": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "price": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "length": {
                          "type": "number"
                        },
                        "offcuts": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "material": {
                          "type": "string"
                        },
                        "remaining": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "engine": {
                    "enum": [
                      "heuristic",
                      "balanced"
                    ],
                    "type": "string"
                  },
                  "timing": {
                    "type": "object",
                    "required": [
                      "solveMs"
                    ],
                    "properties": {
                      "solveMs": {
                        "type": "number"
                      }
                    }
                  },
                  "cutPlan": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "required": [
                        "sheet",
                        "step",
                        "axis",
                        "pos",
                        "length",
                        "stage"
                      ],
                      "properties": {
                        "pos": {
                          "type": "number"
                        },
                        "axis": {
                          "enum": [
                            "h",
                            "v"
                          ],
                          "type": "string"
                        },
                        "step": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "angle": {
                          "type": "number"
                        },
                        "bevel": {
                          "type": "number"
                        },
                        "sheet": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "stage": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "length": {
                          "type": "number",
                          "minimum": 0
                        }
                      }
                    }
                  },
                  "metrics": {
                    "type": "object",
                    "required": [
                      "rodCount",
                      "yieldPct",
                      "placed",
                      "total",
                      "cuts",
                      "totalPrice",
                      "toleranceAcceptedCount"
                    ],
                    "properties": {
                      "cuts": {
                        "type": "integer"
                      },
                      "total": {
                        "type": "integer"
                      },
                      "placed": {
                        "type": "integer"
                      },
                      "rodCount": {
                        "type": "integer"
                      },
                      "yieldPct": {
                        "type": "number"
                      },
                      "sharedCuts": {
                        "type": "integer"
                      },
                      "totalPrice": {
                        "type": "number"
                      },
                      "toleranceAcceptedCount": {
                        "type": "integer"
                      }
                    }
                  },
                  "unplaced": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "length",
                        "qty"
                      ],
                      "properties": {
                        "qty": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "name": {
                          "type": "string"
                        },
                        "length": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "warnings": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "materials": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "material",
                        "rodCount",
                        "yieldPct",
                        "placed",
                        "total",
                        "totalPrice"
                      ],
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "placed": {
                          "type": "integer"
                        },
                        "material": {
                          "type": "string"
                        },
                        "rodCount": {
                          "type": "integer"
                        },
                        "yieldPct": {
                          "type": "number"
                        },
                        "totalPrice": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "deterministic": {
                    "type": "boolean",
                    "const": true
                  },
                  "engineVersion": {
                    "type": "string"
                  },
                  "contractVersion": {
                    "type": "string"
                  },
                  "unmatchedMaterials": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "material",
                        "parts"
                      ],
                      "properties": {
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "length",
                              "qty"
                            ],
                            "properties": {
                              "qty": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "length": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "material": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "jobId",
                  "status",
                  "mode",
                  "engine",
                  "pollAfterMs"
                ],
                "properties": {
                  "mode": {
                    "enum": [
                      "1d"
                    ],
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "quota": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer"
                      },
                      "limit": {
                        "type": "integer"
                      },
                      "reserved": {
                        "type": "integer"
                      }
                    }
                  },
                  "engine": {
                    "enum": [
                      "heuristic",
                      "balanced"
                    ],
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "running"
                    ],
                    "type": "string"
                  },
                  "pollAfterMs": {
                    "type": "integer"
                  }
                }
              }
            ]
          },
          "annotations": {
            "title": "Optimize 1D bars",
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "optimize_wood",
          "title": "Optimize timber",
          "description": "Metered: one Engine API call. Cut timber parts grouped by cross-section from matching stock lengths. Timber optimization (cross-section-aware 1D). Cut lengths from bars that have a CROSS-SECTION. Unlike `/v1/optimize/1d`, where every bar can serve every part, a 50×150 part can only come out of 50×150 stock — so the job is split by cross-section, each section is matched to its own stock and solved separately, and the response carries both per-section and job-wide totals.\n\nFanning the same job out into several `/v1/optimize/1d` calls is not equivalent: it costs one call per section against your quota, moves the stock matching to your code, and cannot distinguish \"no material of this section\" from \"did not fit\" — which this endpoint reports separately as `unmatched` and `unplaced`.\n\n`sw` and `sh` may be given in either order: 50×100 and 100×50 are the same bar turned over and are matched as one section. The response reports the normalised short/long form.",
          "inputSchema": {
            "type": "object",
            "required": [
              "parts",
              "stock"
            ],
            "properties": {
              "async": {
                "enum": [
                  "auto"
                ],
                "type": "string",
                "description": "Opt in to answers that may arrive later. With `\"auto\"` a job that finishes within the synchronous time limit still answers 200 with the plan, exactly as without it; a job that would outgrow the limit answers **202** with a `jobId` instead, keeps solving, and its plan is read with `GET /v1/jobs/{id}` (the same poll as engine `max`). The call is billed once, when the plan is written; a solve that fails is not billed. Without this field such a job answers 504 `solve_timeout` with the `jobId` in `details` and is not charged. The official SDKs send it and wait for the job for you."
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "sw",
                    "sh",
                    "length"
                  ],
                  "properties": {
                    "sh": {
                      "type": "number",
                      "description": "The other side of the cross-section. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "sw": {
                      "type": "number",
                      "description": "One side of the cross-section. ORDER DOES NOT MATTER — 50×100 and 100×50 are the same bar turned over and land in the same section. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1,
                      "description": "How many copies. The sum across all rows must not exceed 2000."
                    },
                    "ends": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "object",
                          "required": [
                            "angle"
                          ],
                          "properties": {
                            "angle": {
                              "type": "number",
                              "description": "The face angle: the mitre or plumb cut as seen on the `depth` side (wood: on `sh` as entered).",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            },
                            "bevel": {
                              "type": "number",
                              "default": 0,
                              "description": "The edge angle: the bevel as seen on the `thickness` side (wood: on `sw` as entered). A compound cut has both.",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            }
                          },
                          "description": "One end cut of a part, in degrees from square (0 = a square end), signed. The part is measured long point to long point (`length` is its overall length). A part whose two end cuts would cross inside its section (shorter than its leads) cannot be made: a 400 `invalid_request` naming `parts[i].ends` says how long it must at least be."
                        },
                        "start": {
                          "type": "object",
                          "required": [
                            "angle"
                          ],
                          "properties": {
                            "angle": {
                              "type": "number",
                              "description": "The face angle: the mitre or plumb cut as seen on the `depth` side (wood: on `sh` as entered).",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            },
                            "bevel": {
                              "type": "number",
                              "default": 0,
                              "description": "The edge angle: the bevel as seen on the `thickness` side (wood: on `sw` as entered). A compound cut has both.",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            }
                          },
                          "description": "One end cut of a part, in degrees from square (0 = a square end), signed. The part is measured long point to long point (`length` is its overall length). A part whose two end cuts would cross inside its section (shorter than its leads) cannot be made: a 400 `invalid_request` naming `parts[i].ends` says how long it must at least be."
                        }
                      },
                      "description": "Angled ends (mitre pairing). The `angle` is seen on `sh` AS ENTERED and the `bevel` on `sw`, so send the section the way the angles were measured."
                    },
                    "flip": {
                      "enum": [
                        "none",
                        "face",
                        "edge",
                        "any"
                      ],
                      "type": "string",
                      "default": "none",
                      "description": "Mitre pairing only: which 180° turns of the part on the bar are allowed, so its angled end can meet a neighbour's. `none` (default — a profiled moulding or one-sided stock), `face` (end for end, the crown or top edge stays up — roof members), `edge` (end for end over the edge — flat stock, frames), `any`."
                    },
                    "meta": {
                      "type": "object",
                      "description": "Opaque JSON object (any keys) echoed back VERBATIM on the matching output (a part's meta on every placed piece of it; a stock row's meta on every sheet/rod cut from it). Attach ERP article numbers, order-line ids, customer refs to reconcile the cut plan with your system. Never parsed, never affects placement. Part meta follows its request row: the meta of each row lands on exactly its qty of placed pieces, even when rows share a name; stock meta by stock-row order."
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "Optional label. Defaults to `Part <1-based row index>`."
                    },
                    "length": {
                      "type": "number",
                      "description": "Cut length. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "Material identity — composes WITH the cross-section: two materials at the same 50×50 become two sections (a 50×50 Pine-Treated part cannot come from a 50×50 Pine-Untreated bar). Free string, library-independent. Absent = today's section-only grouping."
                    },
                    "priority": {
                      "type": "boolean",
                      "description": "Must-cut; wins stock when `options.respectStock` caps it. Applied WITHIN the part's own cross-section, since another section's bars could not have yielded it anyway."
                    }
                  },
                  "description": "A timber part. Same as a 1D part plus the CROSS-SECTION, which decides which stock it can come out of at all."
                },
                "minItems": 1,
                "description": "The timber parts to cut, one row per part type: cross-section `sw` × `sh`, `length`, optional `qty`."
              },
              "stock": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "sw",
                    "sh",
                    "length"
                  ],
                  "properties": {
                    "sh": {
                      "type": "number",
                      "description": "The other side of the cross-section. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "sw": {
                      "type": "number",
                      "description": "One side of the cross-section (either order). Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1,
                      "description": "Bars available. A hard cap only with `options.respectStock`."
                    },
                    "meta": {
                      "type": "object",
                      "description": "Opaque JSON object (any keys) echoed back VERBATIM on the matching output (a part's meta on every placed piece of it; a stock row's meta on every sheet/rod cut from it). Attach ERP article numbers, order-line ids, customer refs to reconcile the cut plan with your system. Never parsed, never affects placement. Part meta follows its request row: the meta of each row lands on exactly its qty of placed pieces, even when rows share a name; stock meta by stock-row order."
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "Optional stock label, echoed back as `sections[].stockName` so a plan can name the material an operator has to fetch."
                    },
                    "price": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Price per bar."
                    },
                    "length": {
                      "type": "number",
                      "description": "Bar length. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side.",
                      "exclusiveMinimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "A stock unit of material X serves only material-X parts. Free string; see the part `material`."
                    },
                    "priority": {
                      "type": "boolean",
                      "description": "\"Use this stock up first\" — a soft preference ranked BELOW sheet/rod count. Steers which format is spent first without spending more of it."
                    }
                  }
                },
                "maxItems": 50,
                "minItems": 1,
                "description": "At most 50 rows. Since every cross-section needs at least one stock row, this is also the practical ceiling on cross-sections in a single job; a wider catalogue should be split into several requests."
              },
              "engine": {
                "enum": [
                  "heuristic",
                  "balanced"
                ],
                "type": "string",
                "default": "heuristic",
                "description": "As in 1D, `max` is not offered here (a **400** before a call is charged). `balanced` resolves to the same packer as `heuristic`: within a section a timber job is a length problem, and free nesting has nothing to offer it. The value is accepted, echoed back, and a warning states which packer actually ran."
              },
              "include": {
                "type": "array",
                "items": {
                  "enum": [
                    "cutPlan",
                    "offcuts",
                    "svg",
                    "csv",
                    "dxf",
                    "labels",
                    "planHash",
                    "pdf",
                    "labelsPdf"
                  ],
                  "type": "string"
                },
                "description": "Three kinds of token. NARROWING (`cutPlan`, `offcuts`): omit the field entirely to get both; a present array keeps only the narrowing tokens it lists (an empty array drops both). ADDITIVE EXPORT (`svg`, `csv`, `dxf`): each adds an inline export STRING to the response (`svg` a standalone 2D layout — 2D only, a warning is returned for 1D/wood; `dxf` an R12/AC1009 drawing; `csv` a cut list, RFC 4180 quoted (a part name with a comma or a quote stays one field) and formula-injection-guarded (a name beginning with `=`, `+`, `-`, `@`, TAB or CR is prefixed with an apostrophe so a spreadsheet reads it as text, not a formula — CWE-1236). 2D DATA (`labels`, `planHash`, `pdf`, `labelsPdf`): `labels` adds per-piece label data (`labels[]`, see `Label2D`), `planHash` a 64-hex fingerprint of the plan (the same plan always gives the same hash), `pdf` the cutting-plan PDF and `labelsPdf` the label PDF, both base64-encoded and drawn by the same code as the CutOptim app. These four are 2D only: a 1D or wood request returns a `warnings` entry instead. `pdf` renders at most 500 parts (total quantity); a larger 2D request with `pdf` is a 413 `too_large` with `details.path: \"include\"`. Export and data tokens do not affect narrowing, so `[\"svg\"]` adds svg and — listing no narrowing token — drops cutPlan/offcuts; use `[\"cutPlan\",\"offcuts\",\"svg\"]` to keep everything."
              },
              "options": {
                "type": "object",
                "properties": {
                  "kerf": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0,
                    "description": "Blade width. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side."
                  },
                  "trim": {
                    "type": "object",
                    "properties": {
                      "end": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side."
                      },
                      "start": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side."
                      }
                    },
                    "description": "A bar has two ends, not four edges. `start` is the leading trim (it shifts the first part along the bar, so the first `pos` equals `start`); `end` is the trailing trim."
                  },
                  "minOffcut": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0,
                    "description": "Output filter: report a leftover only if it is at least this long."
                  },
                  "tolerance": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0,
                    "description": "Accept cuts overshooting by up to this much. Counted in `metrics.toleranceAcceptedCount` and noted in `warnings`."
                  },
                  "minimizeCost": {
                    "type": "boolean",
                    "default": false,
                    "description": "Rank by total bar price."
                  },
                  "mitrePairing": {
                    "type": "boolean",
                    "default": false,
                    "description": "Pair parts of one section whose facing ends (`parts[].ends`) can share ONE saw cut. Off by default: a request without it is solved exactly as before. On, a plan with pairs is returned only when it ranks strictly better than the unpaired plan by the packer's own ranking (parts placed first, then material — or price with `minimizeCost`); otherwise the unpaired plan comes back. Pairs only, no chains of three or more."
                  },
                  "respectStock": {
                    "type": "boolean",
                    "default": false,
                    "description": "Treat `qty` as a hard cap. Applied PER CROSS-SECTION."
                  }
                },
                "description": "Identical to `Options1D` — a cross-section changes what fits, not how a bar is cut."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "engine",
                  "engineVersion",
                  "contractVersion",
                  "deterministic",
                  "sections",
                  "unmatched",
                  "metrics",
                  "unplaced",
                  "warnings",
                  "timing"
                ],
                "properties": {
                  "csv": {
                    "type": "string"
                  },
                  "dxf": {
                    "type": "string"
                  },
                  "engine": {
                    "enum": [
                      "heuristic",
                      "balanced"
                    ],
                    "type": "string"
                  },
                  "timing": {
                    "type": "object",
                    "required": [
                      "solveMs"
                    ],
                    "properties": {
                      "solveMs": {
                        "type": "number"
                      }
                    }
                  },
                  "cutPlan": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "allOf": [
                        {
                          "type": "object",
                          "required": [
                            "sheet",
                            "step",
                            "axis",
                            "pos",
                            "length",
                            "stage"
                          ],
                          "properties": {
                            "pos": {
                              "type": "number"
                            },
                            "axis": {
                              "enum": [
                                "h",
                                "v"
                              ],
                              "type": "string"
                            },
                            "step": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "angle": {
                              "type": "number"
                            },
                            "bevel": {
                              "type": "number"
                            },
                            "sheet": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "stage": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "length": {
                              "type": "number",
                              "minimum": 0
                            }
                          }
                        }
                      ],
                      "required": [
                        "section"
                      ],
                      "properties": {
                        "section": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "metrics": {
                    "type": "object",
                    "required": [
                      "sectionCount",
                      "rodCount",
                      "yieldPct",
                      "placed",
                      "total",
                      "cuts",
                      "totalPrice",
                      "toleranceAcceptedCount"
                    ],
                    "properties": {
                      "cuts": {
                        "type": "integer"
                      },
                      "total": {
                        "type": "integer"
                      },
                      "placed": {
                        "type": "integer"
                      },
                      "rodCount": {
                        "type": "integer"
                      },
                      "yieldPct": {
                        "type": "number"
                      },
                      "sharedCuts": {
                        "type": "integer"
                      },
                      "totalPrice": {
                        "type": "number"
                      },
                      "sectionCount": {
                        "type": "integer"
                      },
                      "toleranceAcceptedCount": {
                        "type": "integer"
                      }
                    }
                  },
                  "sections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "section",
                        "sw",
                        "sh",
                        "stockName",
                        "rods",
                        "metrics",
                        "unplaced"
                      ],
                      "properties": {
                        "sh": {
                          "type": "number"
                        },
                        "sw": {
                          "type": "number"
                        },
                        "rods": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "length",
                              "price",
                              "remaining",
                              "parts"
                            ],
                            "properties": {
                              "meta": {
                                "type": "object"
                              },
                              "parts": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "name",
                                    "pos",
                                    "length"
                                  ],
                                  "properties": {
                                    "pos": {
                                      "type": "number"
                                    },
                                    "meta": {
                                      "type": "object"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "length": {
                                      "type": "number"
                                    },
                                    "flipped": {
                                      "enum": [
                                        "face",
                                        "edge",
                                        "roll"
                                      ],
                                      "type": "string"
                                    },
                                    "sharedCut": {
                                      "type": "object",
                                      "required": [
                                        "angle",
                                        "bevel",
                                        "kerfAlongAxis",
                                        "lead"
                                      ],
                                      "properties": {
                                        "lead": {
                                          "type": "number"
                                        },
                                        "angle": {
                                          "type": "number"
                                        },
                                        "bevel": {
                                          "type": "number"
                                        },
                                        "kerfAlongAxis": {
                                          "type": "number"
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "price": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "length": {
                                "type": "number"
                              },
                              "offcuts": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                }
                              },
                              "material": {
                                "type": "string"
                              },
                              "remaining": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "metrics": {
                          "type": "object",
                          "required": [
                            "rodCount",
                            "yieldPct",
                            "placed",
                            "total",
                            "cuts",
                            "totalPrice"
                          ],
                          "properties": {
                            "cuts": {
                              "type": "integer"
                            },
                            "total": {
                              "type": "integer"
                            },
                            "placed": {
                              "type": "integer"
                            },
                            "rodCount": {
                              "type": "integer"
                            },
                            "yieldPct": {
                              "type": "number"
                            },
                            "totalPrice": {
                              "type": "number"
                            }
                          }
                        },
                        "section": {
                          "type": "string"
                        },
                        "material": {
                          "type": "string"
                        },
                        "unplaced": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "length",
                              "qty"
                            ],
                            "properties": {
                              "qty": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "length": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "stockName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  },
                  "unplaced": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "length",
                        "qty"
                      ],
                      "properties": {
                        "qty": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "name": {
                          "type": "string"
                        },
                        "length": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "warnings": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "unmatched": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "section",
                        "sw",
                        "sh",
                        "parts",
                        "qty"
                      ],
                      "properties": {
                        "sh": {
                          "type": "number"
                        },
                        "sw": {
                          "type": "number"
                        },
                        "qty": {
                          "type": "integer"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "length",
                              "qty"
                            ],
                            "properties": {
                              "qty": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "length": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "section": {
                          "type": "string"
                        },
                        "material": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "deterministic": {
                    "type": "boolean",
                    "const": true
                  },
                  "engineVersion": {
                    "type": "string"
                  },
                  "contractVersion": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "jobId",
                  "status",
                  "mode",
                  "engine",
                  "pollAfterMs"
                ],
                "properties": {
                  "mode": {
                    "enum": [
                      "wood"
                    ],
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "quota": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer"
                      },
                      "limit": {
                        "type": "integer"
                      },
                      "reserved": {
                        "type": "integer"
                      }
                    }
                  },
                  "engine": {
                    "enum": [
                      "heuristic",
                      "balanced"
                    ],
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "running"
                    ],
                    "type": "string"
                  },
                  "pollAfterMs": {
                    "type": "integer"
                  }
                }
              }
            ]
          },
          "annotations": {
            "title": "Optimize timber",
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "optimize_nest",
          "title": "Nest true shapes",
          "description": "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).\n\nTwo 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.\n\n⚠️ `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.\n\nA 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.\n\nEngines: `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`.\n\n**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,",
          "inputSchema": {
            "type": "object",
            "required": [
              "parts",
              "stock"
            ],
            "properties": {
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "oneOf": [
                    {
                      "required": [
                        "polygon"
                      ]
                    },
                    {
                      "required": [
                        "source"
                      ]
                    }
                  ],
                  "properties": {
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1,
                      "description": "Copies to place."
                    },
                    "meta": {
                      "type": "object",
                      "description": "Opaque JSON (your ERP ids), echoed verbatim on every placed copy. Never affects the layout."
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "Optional label, echoed on every placement. Defaults to `source.filename` without its extension when a file was given, otherwise `Part <1-based row index>`."
                    },
                    "holes": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          },
                          "maxItems": 2,
                          "minItems": 2,
                          "description": "An [x, y] vertex, in the caller's chosen unit."
                        },
                        "minItems": 3,
                        "description": "An ordered ring of ≥3 vertices. May be given closed (first == last) or open; the DTO layer normalises. Winding order is not required — it is oriented internally."
                      },
                      "description": "Optional interior holes — a part with a cut-out. NOT accepted together with `source`: the file already carries its own holes."
                    },
                    "source": {
                      "type": "object",
                      "required": [
                        "content"
                      ],
                      "properties": {
                        "format": {
                          "enum": [
                            "svg",
                            "dxf"
                          ],
                          "type": "string",
                          "description": "Omit to sniff the content (an `<svg` tag ⇒ svg, otherwise dxf). An explicit format always wins — including over a misleading `filename` extension."
                        },
                        "content": {
                          "type": "string",
                          "maxLength": 4000000,
                          "description": "The file TEXT — not base64, not a URL, not a multipart upload: both formats are text documents, so they travel inside the JSON body like any other field. Max 4,000,000 characters per file and 8,000,000 across the request; over either is a 413. ⚠️ The HTTP body cap differs by path: 10 MB on `/v1/optimize/nest` and `/v1/import/nest`, but the DEFAULT 1 MB on `/v1/validate/nest`, which is the only nest path that needs no key. A source body over 1 MB therefore validates on the optimize path, not the free one."
                        },
                        "filename": {
                          "type": "string",
                          "maxLength": 200,
                          "description": "Used for format detection AND as the part name when the row has no `name` (extension stripped). Never touches a filesystem."
                        },
                        "flattenTolerance": {
                          "type": "number",
                          "default": 0.2,
                          "description": "Curve / arc flattening tolerance, in the FILE's own coordinate unit. Larger = fewer vertices. This is the lever when a dense outline trips the 2,000-vertex per-ring cap.",
                          "exclusiveMinimum": 0
                        }
                      },
                      "description": "Read this part's outline out of an SVG or DXF FILE instead of listing coordinates. The same parser the CutOptim app uses for its Nesting mode runs server-side, so a part library that already exists as CAD files needs no path/arc flattener of your own.\n\n**The file replaces ONLY the geometry.** `qty`, `material`, `allowedRotations`, `minQuality`, `priority` and `meta` behave exactly as they do on a `polygon` part.\n\n**Exactly ONE outline per source.** Holes are folded in automatically (a ring contained in another becomes a hole), so a typical single-part drawing — outline plus bolt holes — is one outline. A file describing several separate parts is a 400 that names `POST /v1/import/nest`, which splits it.\n\n**Nothing is stored.** The bytes exist only as this request body, are parsed in memory and are gone when the response is written: no disk, no database, no temp file, no log line. There is nothing to delete and nothing retained.\n\n**Units are reported, never applied.** A DXF may declare `$INSUNITS`; it comes back in `imported.units` and several disagreeing files produce a warning, but coordinates pass through verbatim — this API converts nothing (see the unit rule on `/v1/optimize/nest`)."
                    },
                    "polygon": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "maxItems": 2,
                        "minItems": 2,
                        "description": "An [x, y] vertex, in the caller's chosen unit."
                      },
                      "minItems": 3,
                      "description": "An ordered ring of ≥3 vertices. May be given closed (first == last) or open; the DTO layer normalises. Winding order is not required — it is oriented internally."
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "A part of material X nests only on material-X sheets; the job is partitioned by material."
                    },
                    "priority": {
                      "type": "boolean",
                      "description": "Must-cut. With `options.respectStock` (a capped supply, where not every part may fit) these parts are placed first, so a plain part never takes the sheet space a must-cut part needs, and every plan comparison ranks the plan that keeps more of them ahead. Honoured by both engines. Without `respectStock` every part that fits is placed anyway, so the flag changes nothing. A must-cut part that fits no sheet is still listed in `unplaced`."
                    },
                    "minQuality": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 0,
                      "description": "The part may only be placed where sheet quality ≥ this. Default 1 → it avoids every quality-0 exclusion zone. Raise it to keep the part off inferior-but-not-forbidden zones too."
                    },
                    "allowedRotations": {
                      "oneOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        {
                          "enum": [
                            "continuous"
                          ],
                          "type": "string"
                        }
                      ],
                      "description": "Allowed rotations in DEGREES (e.g. [0,90,180,270]). Omit or \"continuous\" for free rotation."
                    }
                  },
                  "description": "A part. Give its outline as `polygon` coordinates OR as a `source` file — exactly one of the two (both, or neither, is a 400)."
                },
                "minItems": 1,
                "description": "One or more parts to nest, one NestPart per row."
              },
              "stock": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "h": {
                      "type": "number",
                      "description": "Rectangular sheet size. Give w & h OR polygon, not both.",
                      "exclusiveMinimum": 0
                    },
                    "w": {
                      "type": "number",
                      "description": "Rectangular sheet size. Give w & h OR polygon, not both.",
                      "exclusiveMinimum": 0
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1,
                      "description": "A HARD cap only when options.respectStock is true."
                    },
                    "cost": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Integer relative per-sheet cost, used by `options.minimizeCost` for a row that has no `price` (e.g. when price is not money)."
                    },
                    "meta": {
                      "type": "object",
                      "description": "Echoed on every sheet cut from this stock row."
                    },
                    "roll": {
                      "type": "boolean",
                      "description": "Marker mode: this row is a ROLL of width `w` and free length (fabric, leather, film, any roll good). Give `w` only — no `h`, `polygon` or `exclusions` — and make it the only stock row. The answer is ONE sheet `w` wide whose `h` is the shortest length found (also `metrics.length`), edge gap included at both ends. Both engines: `lbf` answers synchronously; `max` (async) starts from that marker and spends `options.timeBudgetMs` on a strip search that may shorten it, never lengthen it."
                    },
                    "price": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Per-sheet price. Summed into `totalPrice` / `stockUsage[].totalPrice`, and the ranking key of `options.minimizeCost`."
                    },
                    "polygon": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "maxItems": 2,
                        "minItems": 2,
                        "description": "An [x, y] vertex, in the caller's chosen unit."
                      },
                      "minItems": 3,
                      "description": "Arbitrary sheet outline (an off-cut remnant, a non-rectangular board) instead of w & h."
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "This sheet serves only material-matching parts."
                    },
                    "maxLength": {
                      "type": "number",
                      "maximum": 200000,
                      "description": "With `roll` only: the longest the marker may be (at most 200000). Parts that do not fit within it are returned in `unplaced` — a roll never becomes a second sheet. Omit it and the length is unbounded up to 200000.",
                      "exclusiveMinimum": 0
                    },
                    "exclusions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "polygon"
                        ],
                        "properties": {
                          "polygon": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "maxItems": 2,
                              "minItems": 2,
                              "description": "An [x, y] vertex, in the caller's chosen unit."
                            },
                            "minItems": 3,
                            "description": "An ordered ring of ≥3 vertices. May be given closed (first == last) or open; the DTO layer normalises. Winding order is not required — it is oriented internally."
                          },
                          "quality": {
                            "type": "integer",
                            "default": 0,
                            "minimum": 0,
                            "description": "A zone of quality Q is a hazard for any part whose `minQuality` exceeds Q. Default 0 = hard-forbidden for any part with the default `minQuality` of 1."
                          }
                        },
                        "description": "An exclusion / inferior-quality zone ON a sheet: a defect, a clamp footprint, a pre-printed area — something the rectangular API cannot express."
                      },
                      "description": "Per-sheet excluded / inferior zones: a defect, a clamp footprint, a pre-printed area — what the rectangular API cannot express."
                    }
                  },
                  "description": "A stock sheet type: either a rectangle (w & h) OR an arbitrary polygon outline (an off-cut remnant). Exactly one of {w & h} | polygon."
                },
                "minItems": 1,
                "description": "One or more sheet types, one NestStock per row."
              },
              "engine": {
                "enum": [
                  "lbf",
                  "max",
                  "sparrow"
                ],
                "type": "string",
                "default": "lbf",
                "description": "`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`."
              },
              "include": {
                "type": "array",
                "items": {
                  "enum": [
                    "svg",
                    "dxf"
                  ],
                  "type": "string"
                },
                "description": "Additive 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."
              },
              "options": {
                "type": "object",
                "properties": {
                  "seed": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Determinism: fixed seed → reproducible layout. Omit and the server pins a fixed default, so the response stays reproducible."
                  },
                  "compact": {
                    "type": "boolean",
                    "default": true,
                    "description": "Compact the least-filled sheet of each material (both engines, default on). After the plan is final, that sheet's parts are re-nested on the same sheet with rotation SUBSETS of what each part allows — {0,180}, {0,90,180,270} and a single orientation, intersected with a discrete `allowedRotations`, never a new angle — and the variant with the smallest used area (`sheets[].usedWidth × usedHeight`) is kept. With engine `max` the sheet (when it holds two or more parts) is then also re-packed by the strip search itself — along the sheet's height and, on a one-sheet plan, also along its width; a few seconds on top of the search budget, under a hard time limit — and the result replaces the sheet only when it is strictly smaller under `compactFor` and keeps the spacing and the edge clearance. Sheet count, sizes, price and placed parts are unchanged by construction. Runs within a work budget (a very full last sheet may be left as it is). `false` returns the uncompacted layout."
                  },
                  "compactFor": {
                    "enum": [
                      "box",
                      "horizontal",
                      "vertical"
                    ],
                    "type": "string",
                    "default": "box",
                    "description": "Which used measure the compaction minimises — match it to how you charge a partial sheet. `box` (default): the smallest used bounding area (`usedArea`). `horizontal`: the lowest `usedHeight`, for charging a strip across the full sheet width. `vertical`: the smallest `usedWidth`, for charging a strip over the full sheet height. Ties fall back to the used area; the strip modes also try every copy turned a quarter (90° or 270°, where `allowedRotations` permits it). It only changes which compacted layout is kept: sheet count, sizes, price and placed parts never change, and the result is never worse than the uncompacted layout on that measure. Ignored with `compact: false`."
                  },
                  "minimizeCost": {
                    "type": "boolean",
                    "description": "How engine `lbf` chooses the sheet size when a material has two or more stock rows. It always tries the rows in your order, each row on its own and a cheapest-first order, and keeps the best, so the result does not depend on the order you list them in. Ranking: most must-cut (`parts[].priority`) parts placed → most parts placed → (with `minimizeCost`) lowest total price → least total sheet area → fewest sheets. `minimizeCost` ranks by `price` (or `cost` when a row has no price) only when EVERY row of that material carries one; otherwise it falls back to sheet area and says so in `warnings`. Since 2026-09-22 (F3) the plan may also MIX sizes within a material: every sheet, least-filled first, is re-nested onto the cheaper or smaller rows and replaced when the whole plan ranks better — typically the half-empty last sheet moves to a smaller size. Engine `max` uses the same ranking to decide whether its search result replaces the `lbf` plan."
                  },
                  "respectStock": {
                    "type": "boolean",
                    "description": "Treat each stock qty as a hard cap (both engines; the mixed-size re-nest never uses more sheets of a row than its qty)."
                  },
                  "timeBudgetMs": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Search budget for engine `max`, in milliseconds (default 60000; clamped to 10000–180000, and a clamp is reported in `warnings`). Ignored by `lbf` (no search budget). The job finishes about 1–2 s after the budget, plus any time spent queued; for a job of a few dozen parts 15000 is usually enough. Poll `GET /v1/jobs/{id}` every 2–3 s — polling costs no quota."
                  },
                  "edgeClearance": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Minimum distance between any part and the SHEET EDGE, independent of `minSeparation` (e.g. 5 between parts, 0 or 10 at the edge). Omit it and the edge keeps `minSeparation` (the previous behaviour, unchanged). Both engines. Rectangular sheets only — with a `polygon` sheet it is a 400, as is a value that leaves no room on a sheet (the sheet minus twice `edgeClearance − minSeparation` must stay positive). Exclusion zones keep `minSeparation`, like parts."
                  },
                  "minSeparation": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Minimum clearance between parts and between a part and any hazard (sheet edge / zone). Use for kerf / beam / torch width. Default 0. The sheet-edge part can be set separately with `edgeClearance`."
                  },
                  "simplifyTolerance": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Polygon simplification tolerance (max area deviation as a fraction). Speeds up dense DXF outlines with hundreds of vertices. 0 disables."
                  }
                },
                "description": "Solve options. All optional."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "engine",
                  "engineVersion",
                  "contractVersion",
                  "deterministic",
                  "sheets",
                  "metrics",
                  "stockUsage",
                  "unplaced",
                  "warnings",
                  "timing"
                ],
                "properties": {
                  "dxf": {
                    "type": "string"
                  },
                  "svg": {
                    "type": "string"
                  },
                  "engine": {
                    "enum": [
                      "lbf",
                      "max"
                    ],
                    "type": "string"
                  },
                  "sheets": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "stock",
                        "price",
                        "density",
                        "cutLength",
                        "pierces",
                        "usedWidth",
                        "usedHeight",
                        "usedArea",
                        "parts"
                      ],
                      "properties": {
                        "h": {
                          "type": "number"
                        },
                        "w": {
                          "type": "number"
                        },
                        "meta": {
                          "type": "object"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "sheet",
                              "x",
                              "y",
                              "rotation"
                            ],
                            "properties": {
                              "x": {
                                "type": "number"
                              },
                              "y": {
                                "type": "number"
                              },
                              "meta": {
                                "type": "object"
                              },
                              "name": {
                                "type": "string"
                              },
                              "sheet": {
                                "type": "integer"
                              },
                              "material": {
                                "type": "string"
                              },
                              "rotation": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "price": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "stock": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "density": {
                          "type": "number"
                        },
                        "pierces": {
                          "type": "integer"
                        },
                        "polygon": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            },
                            "maxItems": 2,
                            "minItems": 2
                          },
                          "minItems": 3
                        },
                        "material": {
                          "type": "string"
                        },
                        "usedArea": {
                          "type": "number"
                        },
                        "cutLength": {
                          "type": "number"
                        },
                        "usedWidth": {
                          "type": "number"
                        },
                        "exclusions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "polygon"
                            ],
                            "properties": {
                              "polygon": {
                                "type": "array",
                                "items": {
                                  "type": "array",
                                  "items": {
                                    "type": "number"
                                  },
                                  "maxItems": 2,
                                  "minItems": 2
                                },
                                "minItems": 3
                              },
                              "quality": {
                                "type": "integer",
                                "default": 0,
                                "minimum": 0
                              }
                            }
                          }
                        },
                        "usedHeight": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "timing": {
                    "type": "object",
                    "required": [
                      "solveMs"
                    ],
                    "properties": {
                      "solveMs": {
                        "type": "number"
                      }
                    }
                  },
                  "metrics": {
                    "type": "object",
                    "required": [
                      "sheetCount",
                      "density",
                      "placed",
                      "total",
                      "totalPrice",
                      "cutLength",
                      "pierces"
                    ],
                    "properties": {
                      "total": {
                        "type": "integer"
                      },
                      "length": {
                        "type": "number"
                      },
                      "placed": {
                        "type": "integer"
                      },
                      "density": {
                        "type": "number"
                      },
                      "pierces": {
                        "type": "integer"
                      },
                      "cutLength": {
                        "type": "number"
                      },
                      "sheetCount": {
                        "type": "integer"
                      },
                      "totalPrice": {
                        "type": "number"
                      }
                    }
                  },
                  "imported": {
                    "type": "object",
                    "required": [
                      "parts",
                      "vertices",
                      "units"
                    ],
                    "properties": {
                      "parts": {
                        "type": "integer"
                      },
                      "units": {
                        "type": "array",
                        "items": {
                          "enum": [
                            "mm",
                            "in"
                          ],
                          "type": "string"
                        }
                      },
                      "vertices": {
                        "type": "integer"
                      }
                    }
                  },
                  "unplaced": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "qty"
                      ],
                      "properties": {
                        "qty": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "reason": {
                          "enum": [
                            "too_large",
                            "no_room"
                          ],
                          "type": "string"
                        },
                        "minSheet": {
                          "type": "object",
                          "required": [
                            "w",
                            "h",
                            "rotation"
                          ],
                          "properties": {
                            "h": {
                              "type": "number"
                            },
                            "w": {
                              "type": "number"
                            },
                            "rotation": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  },
                  "warnings": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "materials": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "material",
                        "sheetCount",
                        "density",
                        "placed",
                        "total",
                        "totalPrice"
                      ],
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "placed": {
                          "type": "integer"
                        },
                        "density": {
                          "type": "number"
                        },
                        "material": {
                          "type": "string"
                        },
                        "sheetCount": {
                          "type": "integer"
                        },
                        "totalPrice": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "stockUsage": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "stock",
                        "sheetCount",
                        "totalPrice",
                        "density",
                        "usedArea"
                      ],
                      "properties": {
                        "h": {
                          "type": "number"
                        },
                        "w": {
                          "type": "number"
                        },
                        "stock": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "density": {
                          "type": "number"
                        },
                        "material": {
                          "type": "string"
                        },
                        "usedArea": {
                          "type": "number"
                        },
                        "sheetCount": {
                          "type": "integer"
                        },
                        "totalPrice": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "deterministic": {
                    "type": "boolean"
                  },
                  "engineVersion": {
                    "type": "string"
                  },
                  "contractVersion": {
                    "type": "string"
                  },
                  "unmatchedMaterials": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "material",
                        "parts"
                      ],
                      "properties": {
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "qty"
                            ],
                            "properties": {
                              "qty": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "reason": {
                                "enum": [
                                  "too_large",
                                  "no_room"
                                ],
                                "type": "string"
                              },
                              "minSheet": {
                                "type": "object",
                                "required": [
                                  "w",
                                  "h",
                                  "rotation"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "number"
                                  },
                                  "w": {
                                    "type": "number"
                                  },
                                  "rotation": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "material": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "jobId",
                  "status",
                  "mode",
                  "engine",
                  "pollAfterMs"
                ],
                "properties": {
                  "mode": {
                    "enum": [
                      "nest"
                    ],
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "quota": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer"
                      },
                      "limit": {
                        "type": "integer"
                      },
                      "reserved": {
                        "type": "integer"
                      }
                    }
                  },
                  "engine": {
                    "enum": [
                      "max"
                    ],
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "queued"
                    ],
                    "type": "string"
                  },
                  "pollAfterMs": {
                    "type": "integer"
                  }
                }
              }
            ]
          },
          "annotations": {
            "title": "Nest true shapes",
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "validate_2d",
          "title": "Validate a 2D request",
          "description": "Free, no key needed: checks a 2D request without solving it. Same arguments as optimize_2d (field descriptions there). Validate a 2D request — free, no key, no quota, no solve. Schema-validate the SAME body `/v1/optimize/2d` takes, WITHOUT solving or spending a call. 200 `{valid:true, warnings}` (warnings flag parts that fit no stock — an approximate, solve-free probe), or 400 with the exact bad field path. Open like `/v1/health`: validate payloads during integration before you even have a key. The engine verdict matches the optimize path exactly, `engine: \"max\"` included: a body this endpoint accepts is one `/v1/optimize/2d` will accept, and one it refuses (400 for an option the max tier cannot model, 503 where that tier is not enabled) is refused there too.",
          "inputSchema": {
            "type": "object",
            "required": [
              "parts",
              "stock"
            ],
            "properties": {
              "async": {
                "enum": [
                  "auto"
                ],
                "type": "string",
                "description": "Opt in to answers that may arrive later. With `\"auto\"` a job that finishes within the synchronous time limit still answers 200 with the plan, exactly as without it; a job that would outgrow the limit answers **202** with a `jobId` instead, keeps solving, and its plan is read with `GET /v1/jobs/{id}` (the same poll as engine `max`). The call is billed once, when the plan is written; a solve that fails is not billed. Without this field such a job answers 504 `solve_timeout` with the `jobId` in `details` and is not charged. The official SDKs send it and wait for the job for you."
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "w",
                    "h"
                  ],
                  "properties": {
                    "h": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "w": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "id": {},
                    "qr": {
                      "type": "string",
                      "maxLength": 300,
                      "minLength": 1
                    },
                    "qrs": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 300,
                        "minLength": 1
                      },
                      "maxItems": 2000,
                      "minItems": 1
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "meta": {
                      "type": "object"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "grain": {
                      "enum": [
                        "w",
                        "h"
                      ],
                      "type": "string"
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "priority": {
                      "type": "boolean"
                    },
                    "rotatable": {
                      "type": "boolean",
                      "default": true
                    },
                    "grainGroup": {
                      "type": "string",
                      "maxLength": 200,
                      "deprecated": true
                    },
                    "edgeBanding": {
                      "type": "object",
                      "properties": {
                        "top": {
                          "type": "string",
                          "maxLength": 200
                        },
                        "left": {
                          "type": "string",
                          "maxLength": 200
                        },
                        "right": {
                          "type": "string",
                          "maxLength": 200
                        },
                        "bottom": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    }
                  }
                },
                "minItems": 1,
                "description": "The rectangular parts to cut, one row per part type (`w`, `h`, optional `qty`, `name`, grain, edge banding)."
              },
              "stock": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "w",
                    "h"
                  ],
                  "properties": {
                    "h": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "w": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "meta": {
                      "type": "object"
                    },
                    "grain": {
                      "enum": [
                        "w",
                        "h"
                      ],
                      "type": "string"
                    },
                    "price": {
                      "type": "number",
                      "minimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "priority": {
                      "type": "boolean"
                    }
                  }
                },
                "maxItems": 50,
                "minItems": 1,
                "description": "The sheet sizes to cut from, one row per size (`w`, `h`, optional `qty`, `price`)."
              },
              "engine": {
                "enum": [
                  "heuristic",
                  "balanced",
                  "max"
                ],
                "type": "string",
                "default": "heuristic",
                "description": "Which optimizer to run. `heuristic` is the guillotine multi-strategy packer: highest yield, every layout edge-to-edge saw-cuttable, always a full `cutPlan`. `balanced` is a MaxRects free-nesting packer: much faster on large jobs for a small yield cost, but its layouts are often not guillotine (`guillotineValid: false`, `cutPlan: null`), and it does not model `tolerance`, `minimizeCost`, `grainGroup`, `maxCutStages` or `minimizeRotations` — set one of those and a string in `warnings` tells you it was ignored. `max` is the ASYNCHRONOUS tree-search tier (2D only): it reaches the proven optimum on far more jobs at the cost of seconds-to-a-minute per solve, so instead of a plan it returns **202** with a `jobId` — poll `GET /v1/jobs/{id}` for the result. Still deterministic and guillotine-valid. Where the tier is not enabled on a deployment, `engine: \"max\"` fails closed with **503**. **What `max` models.** It packs ONE stock format at full sheet size with unlimited supply and a fixed 3-stage guillotine pattern. Anything that would make the returned plan physically WRONG is therefore REFUSED with **400** at submission — before a call is reserved and before you wait for the solve: a second `stock` row, `options.trim`, `options.respectStock`, any `material`, any `grainGroup`, a non-empty `matchedSets` (an empty one is fine). Options that only make the plan less tuned are accepted and listed in `warnings`: `tolerance`, `minimizeCost`, `maxCutStages` (fixed at 3), `minimizeRotations`, `firstCut`, `effort`. A `max` result reports no `offcuts`. Send those jobs to `heuristic`. The default never changes silently."
              },
              "include": {
                "type": "array",
                "items": {
                  "enum": [
                    "cutPlan",
                    "offcuts",
                    "svg",
                    "csv",
                    "dxf",
                    "labels",
                    "planHash",
                    "pdf",
                    "labelsPdf"
                  ],
                  "type": "string"
                },
                "description": "Three kinds of token. NARROWING (`cutPlan`, `offcuts`): omit the field entirely to get both; a present array keeps only the narrowing tokens it lists (an empty array drops both). ADDITIVE EXPORT (`svg`, `csv`, `dxf`): each adds an inline export STRING to the response (`svg` a standalone 2D layout — 2D only, a warning is returned for 1D/wood; `dxf` an R12/AC1009 drawing; `csv` a cut list, RFC 4180 quoted (a part name with a comma or a quote stays one field) and formula-injection-guarded (a name beginning with `=`, `+`, `-`, `@`, TAB or CR is prefixed with an apostrophe so a spreadsheet reads it as text, not a formula — CWE-1236). 2D DATA (`labels`, `planHash`, `pdf`, `labelsPdf`): `labels` adds per-piece label data (`labels[]`, see `Label2D`), `planHash` a 64-hex fingerprint of the plan (the same plan always gives the same hash), `pdf` the cutting-plan PDF and `labelsPdf` the label PDF, both base64-encoded and drawn by the same code as the CutOptim app. These four are 2D only: a 1D or wood request returns a `warnings` entry instead. `pdf` renders at most 500 parts (total quantity); a larger 2D request with `pdf` is a 413 `too_large` with `details.path: \"include\"`. Export and data tokens do not affect narrowing, so `[\"svg\"]` adds svg and — listing no narrowing token — drops cutPlan/offcuts; use `[\"cutPlan\",\"offcuts\",\"svg\"]` to keep everything."
              },
              "options": {
                "type": "object",
                "properties": {
                  "kerf": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "trim": {
                    "type": "object",
                    "properties": {
                      "top": {
                        "type": "number",
                        "minimum": 0
                      },
                      "left": {
                        "type": "number",
                        "minimum": 0
                      },
                      "right": {
                        "type": "number",
                        "minimum": 0
                      },
                      "bottom": {
                        "type": "number",
                        "minimum": 0
                      }
                    }
                  },
                  "effort": {
                    "enum": [
                      "fast",
                      "balanced"
                    ],
                    "type": "string",
                    "default": "balanced"
                  },
                  "labels": {
                    "type": "object",
                    "properties": {
                      "order": {
                        "enum": [
                          "input",
                          "cut"
                        ],
                        "type": "string",
                        "default": "input"
                      },
                      "parts": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "maximum": 999999,
                          "minimum": 1
                        },
                        "maxItems": 500
                      },
                      "width": {
                        "type": "number",
                        "default": 100,
                        "maximum": 300,
                        "minimum": 20
                      },
                      "format": {
                        "enum": [
                          "sheet",
                          "roll",
                          "apli-03056",
                          "brother-dk-11201"
                        ],
                        "type": "string",
                        "default": "sheet"
                      },
                      "height": {
                        "type": "number",
                        "default": 40,
                        "maximum": 300,
                        "minimum": 15
                      },
                      "offset": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number",
                            "default": 0,
                            "maximum": 20,
                            "minimum": -20
                          },
                          "y": {
                            "type": "number",
                            "default": 0,
                            "maximum": 20,
                            "minimum": -20
                          }
                        },
                        "additionalProperties": false
                      },
                      "partNo": {
                        "type": "boolean",
                        "default": false
                      },
                      "stages": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 6,
                          "minLength": 1
                        },
                        "maxItems": 6
                      },
                      "dimSize": {
                        "enum": [
                          "normal",
                          "large",
                          "xl"
                        ],
                        "type": "string",
                        "default": "normal"
                      },
                      "stageWords": {
                        "type": "object",
                        "properties": {
                          "d": {
                            "type": "string",
                            "maxLength": 6
                          },
                          "s": {
                            "type": "string",
                            "maxLength": 6
                          },
                          "eb": {
                            "type": "string",
                            "maxLength": 6
                          },
                          "rc": {
                            "type": "string",
                            "maxLength": 6
                          },
                          "c2s": {
                            "type": "string",
                            "maxLength": 6
                          }
                        },
                        "additionalProperties": false
                      },
                      "factoryEdges": {
                        "type": "boolean",
                        "default": false
                      },
                      "hiddenFaceHint": {
                        "type": "boolean",
                        "default": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "firstCut": {
                    "enum": [
                      "auto",
                      "horizontal",
                      "vertical"
                    ],
                    "type": "string",
                    "default": "auto"
                  },
                  "minOffcut": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "tolerance": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "setOutlines": {
                    "default": true
                  },
                  "maxCutStages": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "minimizeCost": {
                    "type": "boolean",
                    "default": false
                  },
                  "respectStock": {
                    "type": "boolean",
                    "default": false
                  },
                  "minimizeRotations": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "description": "Kerf, trim, first-cut direction, cost and stock rules, effort and label output; every field is optional."
              },
              "matchedSets": {
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "layout"
                  ],
                  "properties": {
                    "id": {
                      "type": [
                        "string",
                        "integer"
                      ],
                      "maxLength": 64
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "grain": {
                      "enum": [
                        "w",
                        "h",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "layout": {
                      "type": "object",
                      "required": [
                        "dir",
                        "lines"
                      ],
                      "properties": {
                        "dir": {
                          "enum": [
                            "rows",
                            "cols"
                          ],
                          "type": "string"
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": [
                                "string",
                                "integer"
                              ]
                            },
                            "minItems": 1
                          },
                          "minItems": 1
                        }
                      }
                    },
                    "onMiss": {
                      "enum": [
                        "split",
                        "unplaced"
                      ],
                      "type": "string",
                      "default": "split"
                    },
                    "installGap": {
                      "type": "number",
                      "minimum": 0
                    }
                  }
                },
                "maxItems": 50,
                "description": "Matched sets (grain matching): groups of parts cut side by side from one piece of board. Send a NON-EMPTY ARRAY of sets (at most 50); members are named by `parts[].id`. Only a non-empty array switches the feature on: absent, `null`, `[]` — and any value that is not an array — is a request without sets, answered exactly as before (no error). With sets the response adds `sheets[].parts[].matchedSet` on every member and a `matchedSets` rollup; `csv` gains `Set` and `Position` columns at the end, `svg` the `matched-sets` frame group, `dxf` the position code on LABELS; `pdf` and `labelsPdf` draw the members as ordinary parts for now (a `warnings` line says so; the set marks are in `sheets[].parts[].matchedSet`, `csv` and `svg`). Engine `max` refuses a non-empty array (400 `details.unsupported`); an empty one is fine. 2D only: the 1D, wood and nest endpoints ignore this field and `parts[].id`."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "valid",
              "mode",
              "contractVersion",
              "parts",
              "stock",
              "warnings"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "2d",
                  "1d",
                  "wood",
                  "nest"
                ],
                "type": "string"
              },
              "parts": {
                "type": "object",
                "required": [
                  "rows",
                  "total"
                ],
                "properties": {
                  "rows": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "stock": {
                "type": "object",
                "required": [
                  "rows",
                  "total"
                ],
                "properties": {
                  "rows": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "valid": {
                "type": "boolean"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "engineEnabled": {
                "type": "boolean"
              },
              "contractVersion": {
                "type": "string"
              }
            }
          },
          "annotations": {
            "title": "Validate a 2D request",
            "readOnlyHint": true,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "validate_1d",
          "title": "Validate a 1D request",
          "description": "Free, no key needed: checks a 1D request without solving it. Same arguments as optimize_1d (field descriptions there). Validate a 1D request — free, no key, no quota, no solve. Schema-validate the SAME body `/v1/optimize/1d` takes, WITHOUT solving or spending a call. See `/v1/validate/2d`.",
          "inputSchema": {
            "type": "object",
            "required": [
              "parts",
              "stock"
            ],
            "properties": {
              "async": {
                "enum": [
                  "auto"
                ],
                "type": "string",
                "description": "Opt in to answers that may arrive later. With `\"auto\"` a job that finishes within the synchronous time limit still answers 200 with the plan, exactly as without it; a job that would outgrow the limit answers **202** with a `jobId` instead, keeps solving, and its plan is read with `GET /v1/jobs/{id}` (the same poll as engine `max`). The call is billed once, when the plan is written; a solve that fails is not billed. Without this field such a job answers 504 `solve_timeout` with the `jobId` in `details` and is not charged. The official SDKs send it and wait for the job for you."
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "length"
                  ],
                  "properties": {
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "ends": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "object",
                          "required": [
                            "angle"
                          ],
                          "properties": {
                            "angle": {
                              "type": "number",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            },
                            "bevel": {
                              "type": "number",
                              "default": 0,
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            }
                          }
                        },
                        "start": {
                          "type": "object",
                          "required": [
                            "angle"
                          ],
                          "properties": {
                            "angle": {
                              "type": "number",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            },
                            "bevel": {
                              "type": "number",
                              "default": 0,
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            }
                          }
                        }
                      }
                    },
                    "flip": {
                      "enum": [
                        "none",
                        "face",
                        "edge",
                        "any"
                      ],
                      "type": "string",
                      "default": "none"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "depth": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "length": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "priority": {
                      "type": "boolean"
                    },
                    "thickness": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  }
                },
                "minItems": 1,
                "description": "The lengths to cut, one row per part type (`length`, optional `qty`, `name`, mitred `ends`)."
              },
              "stock": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "length"
                  ],
                  "properties": {
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "meta": {
                      "type": "object"
                    },
                    "price": {
                      "type": "number",
                      "minimum": 0
                    },
                    "length": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "priority": {
                      "type": "boolean"
                    }
                  }
                },
                "maxItems": 50,
                "minItems": 1,
                "description": "The bar lengths to cut from, one row per length (`length`, optional `qty`, `price`)."
              },
              "engine": {
                "enum": [
                  "heuristic",
                  "balanced"
                ],
                "type": "string",
                "default": "heuristic",
                "description": "`max` is not offered here: it is a 2D (and, separately, nesting) tier, and `engine: \"max\"` on this path is a **400** before a call is charged. In 1D `balanced` resolves to the same packer as `heuristic` — the linear packer is already a best-of-multiple-strategies search, so there is no separate balanced mode. The value is accepted and echoed back so a single client can send one engine id for both endpoints."
              },
              "include": {
                "type": "array",
                "items": {
                  "enum": [
                    "cutPlan",
                    "offcuts",
                    "svg",
                    "csv",
                    "dxf",
                    "labels",
                    "planHash",
                    "pdf",
                    "labelsPdf"
                  ],
                  "type": "string"
                },
                "description": "Three kinds of token. NARROWING (`cutPlan`, `offcuts`): omit the field entirely to get both; a present array keeps only the narrowing tokens it lists (an empty array drops both). ADDITIVE EXPORT (`svg`, `csv`, `dxf`): each adds an inline export STRING to the response (`svg` a standalone 2D layout — 2D only, a warning is returned for 1D/wood; `dxf` an R12/AC1009 drawing; `csv` a cut list, RFC 4180 quoted (a part name with a comma or a quote stays one field) and formula-injection-guarded (a name beginning with `=`, `+`, `-`, `@`, TAB or CR is prefixed with an apostrophe so a spreadsheet reads it as text, not a formula — CWE-1236). 2D DATA (`labels`, `planHash`, `pdf`, `labelsPdf`): `labels` adds per-piece label data (`labels[]`, see `Label2D`), `planHash` a 64-hex fingerprint of the plan (the same plan always gives the same hash), `pdf` the cutting-plan PDF and `labelsPdf` the label PDF, both base64-encoded and drawn by the same code as the CutOptim app. These four are 2D only: a 1D or wood request returns a `warnings` entry instead. `pdf` renders at most 500 parts (total quantity); a larger 2D request with `pdf` is a 413 `too_large` with `details.path: \"include\"`. Export and data tokens do not affect narrowing, so `[\"svg\"]` adds svg and — listing no narrowing token — drops cutPlan/offcuts; use `[\"cutPlan\",\"offcuts\",\"svg\"]` to keep everything."
              },
              "options": {
                "type": "object",
                "properties": {
                  "kerf": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "trim": {
                    "type": "object",
                    "properties": {
                      "end": {
                        "type": "number",
                        "minimum": 0
                      },
                      "start": {
                        "type": "number",
                        "minimum": 0
                      }
                    }
                  },
                  "minOffcut": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "tolerance": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "minimizeCost": {
                    "type": "boolean",
                    "default": false
                  },
                  "mitrePairing": {
                    "type": "boolean",
                    "default": false
                  },
                  "respectStock": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "description": "The 1D option set is deliberately smaller: there is no `firstCut`, `maxCutStages` or `minimizeRotations`, because none of them means anything on a bar."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "valid",
              "mode",
              "contractVersion",
              "parts",
              "stock",
              "warnings"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "2d",
                  "1d",
                  "wood",
                  "nest"
                ],
                "type": "string"
              },
              "parts": {
                "type": "object",
                "required": [
                  "rows",
                  "total"
                ],
                "properties": {
                  "rows": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "stock": {
                "type": "object",
                "required": [
                  "rows",
                  "total"
                ],
                "properties": {
                  "rows": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "valid": {
                "type": "boolean"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "engineEnabled": {
                "type": "boolean"
              },
              "contractVersion": {
                "type": "string"
              }
            }
          },
          "annotations": {
            "title": "Validate a 1D request",
            "readOnlyHint": true,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "validate_wood",
          "title": "Validate a timber request",
          "description": "Free, no key needed: checks a timber request without solving it. Same arguments as optimize_wood (field descriptions there). Validate a wood request — free, no key, no quota, no solve. Schema-validate the SAME body `/v1/optimize/wood` takes, WITHOUT solving or spending a call. Warnings flag parts with no matching-section stock long enough. See `/v1/validate/2d`.",
          "inputSchema": {
            "type": "object",
            "required": [
              "parts",
              "stock"
            ],
            "properties": {
              "async": {
                "enum": [
                  "auto"
                ],
                "type": "string",
                "description": "Opt in to answers that may arrive later. With `\"auto\"` a job that finishes within the synchronous time limit still answers 200 with the plan, exactly as without it; a job that would outgrow the limit answers **202** with a `jobId` instead, keeps solving, and its plan is read with `GET /v1/jobs/{id}` (the same poll as engine `max`). The call is billed once, when the plan is written; a solve that fails is not billed. Without this field such a job answers 504 `solve_timeout` with the `jobId` in `details` and is not charged. The official SDKs send it and wait for the job for you."
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "sw",
                    "sh",
                    "length"
                  ],
                  "properties": {
                    "sh": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "sw": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "ends": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "object",
                          "required": [
                            "angle"
                          ],
                          "properties": {
                            "angle": {
                              "type": "number",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            },
                            "bevel": {
                              "type": "number",
                              "default": 0,
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            }
                          }
                        },
                        "start": {
                          "type": "object",
                          "required": [
                            "angle"
                          ],
                          "properties": {
                            "angle": {
                              "type": "number",
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            },
                            "bevel": {
                              "type": "number",
                              "default": 0,
                              "exclusiveMaximum": 90,
                              "exclusiveMinimum": -90
                            }
                          }
                        }
                      }
                    },
                    "flip": {
                      "enum": [
                        "none",
                        "face",
                        "edge",
                        "any"
                      ],
                      "type": "string",
                      "default": "none"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "length": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "priority": {
                      "type": "boolean"
                    }
                  }
                },
                "minItems": 1,
                "description": "The timber parts to cut, one row per part type: cross-section `sw` × `sh`, `length`, optional `qty`."
              },
              "stock": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "sw",
                    "sh",
                    "length"
                  ],
                  "properties": {
                    "sh": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "sw": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "meta": {
                      "type": "object"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "price": {
                      "type": "number",
                      "minimum": 0
                    },
                    "length": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "priority": {
                      "type": "boolean"
                    }
                  }
                },
                "maxItems": 50,
                "minItems": 1,
                "description": "At most 50 rows. Since every cross-section needs at least one stock row, this is also the practical ceiling on cross-sections in a single job; a wider catalogue should be split into several requests."
              },
              "engine": {
                "enum": [
                  "heuristic",
                  "balanced"
                ],
                "type": "string",
                "default": "heuristic",
                "description": "As in 1D, `max` is not offered here (a **400** before a call is charged). `balanced` resolves to the same packer as `heuristic`: within a section a timber job is a length problem, and free nesting has nothing to offer it. The value is accepted, echoed back, and a warning states which packer actually ran."
              },
              "include": {
                "type": "array",
                "items": {
                  "enum": [
                    "cutPlan",
                    "offcuts",
                    "svg",
                    "csv",
                    "dxf",
                    "labels",
                    "planHash",
                    "pdf",
                    "labelsPdf"
                  ],
                  "type": "string"
                },
                "description": "Three kinds of token. NARROWING (`cutPlan`, `offcuts`): omit the field entirely to get both; a present array keeps only the narrowing tokens it lists (an empty array drops both). ADDITIVE EXPORT (`svg`, `csv`, `dxf`): each adds an inline export STRING to the response (`svg` a standalone 2D layout — 2D only, a warning is returned for 1D/wood; `dxf` an R12/AC1009 drawing; `csv` a cut list, RFC 4180 quoted (a part name with a comma or a quote stays one field) and formula-injection-guarded (a name beginning with `=`, `+`, `-`, `@`, TAB or CR is prefixed with an apostrophe so a spreadsheet reads it as text, not a formula — CWE-1236). 2D DATA (`labels`, `planHash`, `pdf`, `labelsPdf`): `labels` adds per-piece label data (`labels[]`, see `Label2D`), `planHash` a 64-hex fingerprint of the plan (the same plan always gives the same hash), `pdf` the cutting-plan PDF and `labelsPdf` the label PDF, both base64-encoded and drawn by the same code as the CutOptim app. These four are 2D only: a 1D or wood request returns a `warnings` entry instead. `pdf` renders at most 500 parts (total quantity); a larger 2D request with `pdf` is a 413 `too_large` with `details.path: \"include\"`. Export and data tokens do not affect narrowing, so `[\"svg\"]` adds svg and — listing no narrowing token — drops cutPlan/offcuts; use `[\"cutPlan\",\"offcuts\",\"svg\"]` to keep everything."
              },
              "options": {
                "type": "object",
                "properties": {
                  "kerf": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "trim": {
                    "type": "object",
                    "properties": {
                      "end": {
                        "type": "number",
                        "minimum": 0
                      },
                      "start": {
                        "type": "number",
                        "minimum": 0
                      }
                    }
                  },
                  "minOffcut": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "tolerance": {
                    "type": "number",
                    "default": 0,
                    "minimum": 0
                  },
                  "minimizeCost": {
                    "type": "boolean",
                    "default": false
                  },
                  "mitrePairing": {
                    "type": "boolean",
                    "default": false
                  },
                  "respectStock": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "description": "Identical to `Options1D` — a cross-section changes what fits, not how a bar is cut."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "valid",
              "mode",
              "contractVersion",
              "parts",
              "stock",
              "warnings"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "2d",
                  "1d",
                  "wood",
                  "nest"
                ],
                "type": "string"
              },
              "parts": {
                "type": "object",
                "required": [
                  "rows",
                  "total"
                ],
                "properties": {
                  "rows": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "stock": {
                "type": "object",
                "required": [
                  "rows",
                  "total"
                ],
                "properties": {
                  "rows": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "valid": {
                "type": "boolean"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "engineEnabled": {
                "type": "boolean"
              },
              "contractVersion": {
                "type": "string"
              }
            }
          },
          "annotations": {
            "title": "Validate a timber request",
            "readOnlyHint": true,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "validate_nest",
          "title": "Validate a nesting request",
          "description": "Free, no key needed: checks a nesting request without solving it. Same arguments as optimize_nest (field descriptions there). Validate a nest request — free, no key, no quota, no solve. Schema-validate the SAME body `/v1/optimize/nest` takes, WITHOUT solving or spending a call. Reports `engineEnabled` (whether the nesting engine is built into this deployment) and warns about parts whose bounding box fits no stock sheet. For `engine: \"max\"` the verdict matches the optimize path exactly: 400 for anything outside the preview scope, 503 where the async tier is not enabled, and otherwise a warning that the job will be asynchronous. See `/v1/validate/2d`.",
          "inputSchema": {
            "type": "object",
            "required": [
              "parts",
              "stock"
            ],
            "properties": {
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "oneOf": [
                    {
                      "required": [
                        "polygon"
                      ]
                    },
                    {
                      "required": [
                        "source"
                      ]
                    }
                  ],
                  "properties": {
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "meta": {
                      "type": "object"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "holes": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          },
                          "maxItems": 2,
                          "minItems": 2
                        },
                        "minItems": 3
                      }
                    },
                    "source": {
                      "type": "object",
                      "required": [
                        "content"
                      ],
                      "properties": {
                        "format": {
                          "enum": [
                            "svg",
                            "dxf"
                          ],
                          "type": "string"
                        },
                        "content": {
                          "type": "string",
                          "maxLength": 4000000
                        },
                        "filename": {
                          "type": "string",
                          "maxLength": 200
                        },
                        "flattenTolerance": {
                          "type": "number",
                          "default": 0.2,
                          "exclusiveMinimum": 0
                        }
                      }
                    },
                    "polygon": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "maxItems": 2,
                        "minItems": 2
                      },
                      "minItems": 3
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "priority": {
                      "type": "boolean"
                    },
                    "minQuality": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 0
                    },
                    "allowedRotations": {
                      "oneOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        {
                          "enum": [
                            "continuous"
                          ],
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                "minItems": 1,
                "description": "One or more parts to nest, one NestPart per row."
              },
              "stock": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "h": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "w": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "qty": {
                      "type": "integer",
                      "default": 1,
                      "minimum": 1
                    },
                    "cost": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "meta": {
                      "type": "object"
                    },
                    "roll": {
                      "type": "boolean"
                    },
                    "price": {
                      "type": "number",
                      "minimum": 0
                    },
                    "polygon": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "maxItems": 2,
                        "minItems": 2
                      },
                      "minItems": 3
                    },
                    "material": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "maxLength": {
                      "type": "number",
                      "maximum": 200000,
                      "exclusiveMinimum": 0
                    },
                    "exclusions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "polygon"
                        ],
                        "properties": {
                          "polygon": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "maxItems": 2,
                              "minItems": 2
                            },
                            "minItems": 3
                          },
                          "quality": {
                            "type": "integer",
                            "default": 0,
                            "minimum": 0
                          }
                        }
                      }
                    }
                  }
                },
                "minItems": 1,
                "description": "One or more sheet types, one NestStock per row."
              },
              "engine": {
                "enum": [
                  "lbf",
                  "max",
                  "sparrow"
                ],
                "type": "string",
                "default": "lbf",
                "description": "`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`."
              },
              "include": {
                "type": "array",
                "items": {
                  "enum": [
                    "svg",
                    "dxf"
                  ],
                  "type": "string"
                },
                "description": "Additive 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."
              },
              "options": {
                "type": "object",
                "properties": {
                  "seed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "compact": {
                    "type": "boolean",
                    "default": true
                  },
                  "compactFor": {
                    "enum": [
                      "box",
                      "horizontal",
                      "vertical"
                    ],
                    "type": "string",
                    "default": "box"
                  },
                  "minimizeCost": {
                    "type": "boolean"
                  },
                  "respectStock": {
                    "type": "boolean"
                  },
                  "timeBudgetMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "edgeClearance": {
                    "type": "number",
                    "minimum": 0
                  },
                  "minSeparation": {
                    "type": "number",
                    "minimum": 0
                  },
                  "simplifyTolerance": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "description": "Solve options. All optional."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "valid",
              "mode",
              "contractVersion",
              "parts",
              "stock",
              "warnings"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "2d",
                  "1d",
                  "wood",
                  "nest"
                ],
                "type": "string"
              },
              "parts": {
                "type": "object",
                "required": [
                  "rows",
                  "total"
                ],
                "properties": {
                  "rows": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "stock": {
                "type": "object",
                "required": [
                  "rows",
                  "total"
                ],
                "properties": {
                  "rows": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "valid": {
                "type": "boolean"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "engineEnabled": {
                "type": "boolean"
              },
              "contractVersion": {
                "type": "string"
              }
            }
          },
          "annotations": {
            "title": "Validate a nesting request",
            "readOnlyHint": true,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_job",
          "title": "Get an async job",
          "description": "Free (needs the key that submitted the job). Reads an engine \"max\" job; when it succeeded, the plan is in result. Poll an async max-engine job. Fetch the status (and, when finished, the plan) of a job submitted with `engine: \"max\"`. A job is `queued`, then `running`, then `succeeded` (with `result` = the same response shape a synchronous solve of that `mode` returns, carrying `engine: \"max\"` — a 2D plan for `mode: \"2d\"`, a nest for `mode: \"nest\"`) or `failed` (with `error`). Polling spends no quota, but the key must still be usable: a revoked key or a lapsed API subscription is refused with 403 here exactly as it is on every other authenticated path. A caller sees only its own jobs — a job id belonging to another account is reported as 401 \"job not found\", indistinguishable from one that does not exist, so ids cannot be probed.",
          "inputSchema": {
            "type": "object",
            "required": [
              "jobId"
            ],
            "properties": {
              "jobId": {
                "type": "string",
                "format": "uuid",
                "description": "The jobId from the 202 submission."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "jobId",
              "status",
              "mode",
              "engine"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "2d",
                  "nest",
                  "1d",
                  "wood"
                ],
                "type": "string"
              },
              "error": {
                "type": "string"
              },
              "jobId": {
                "type": "string",
                "format": "uuid"
              },
              "engine": {
                "enum": [
                  "max",
                  "heuristic",
                  "balanced"
                ],
                "type": "string"
              },
              "result": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "engine",
                      "engineVersion",
                      "contractVersion",
                      "deterministic",
                      "sheets",
                      "metrics",
                      "unplaced",
                      "warnings",
                      "guillotineValid",
                      "timing"
                    ],
                    "properties": {
                      "csv": {
                        "type": "string"
                      },
                      "dxf": {
                        "type": "string"
                      },
                      "pdf": {
                        "type": "string",
                        "format": "byte"
                      },
                      "svg": {
                        "type": "string"
                      },
                      "engine": {
                        "enum": [
                          "heuristic",
                          "balanced",
                          "max"
                        ],
                        "type": "string"
                      },
                      "labels": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "sheet",
                            "name",
                            "partNo",
                            "w",
                            "h",
                            "rotated",
                            "x",
                            "y"
                          ],
                          "properties": {
                            "h": {
                              "type": "number"
                            },
                            "w": {
                              "type": "number"
                            },
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            },
                            "of": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "qr": {
                              "type": "string"
                            },
                            "meta": {
                              "type": "object"
                            },
                            "name": {
                              "type": "string"
                            },
                            "edges": {
                              "type": "object",
                              "properties": {
                                "top": {
                                  "type": "object",
                                  "required": [
                                    "reference",
                                    "length"
                                  ],
                                  "properties": {
                                    "length": {
                                      "type": "number"
                                    },
                                    "reference": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "left": {
                                  "type": "object",
                                  "required": [
                                    "reference",
                                    "length"
                                  ],
                                  "properties": {
                                    "length": {
                                      "type": "number"
                                    },
                                    "reference": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "right": {
                                  "type": "object",
                                  "required": [
                                    "reference",
                                    "length"
                                  ],
                                  "properties": {
                                    "length": {
                                      "type": "number"
                                    },
                                    "reference": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "bottom": {
                                  "type": "object",
                                  "required": [
                                    "reference",
                                    "length"
                                  ],
                                  "properties": {
                                    "length": {
                                      "type": "number"
                                    },
                                    "reference": {
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            },
                            "grain": {
                              "enum": [
                                "w",
                                "h"
                              ],
                              "type": "string"
                            },
                            "piece": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "sheet": {
                              "type": "integer"
                            },
                            "partNo": {
                              "type": "integer"
                            },
                            "rotated": {
                              "type": "boolean"
                            },
                            "sheetNo": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "material": {
                              "type": "string"
                            },
                            "stockRow": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "sheetMeta": {
                              "type": "object"
                            }
                          }
                        }
                      },
                      "sheets": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "w",
                            "h",
                            "price",
                            "parts"
                          ],
                          "properties": {
                            "h": {
                              "type": "number"
                            },
                            "w": {
                              "type": "number"
                            },
                            "meta": {
                              "type": "object"
                            },
                            "grain": {
                              "enum": [
                                "w",
                                "h"
                              ],
                              "type": "string"
                            },
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "x",
                                  "y",
                                  "w",
                                  "h",
                                  "rotated"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "number"
                                  },
                                  "w": {
                                    "type": "number"
                                  },
                                  "x": {
                                    "type": "number"
                                  },
                                  "y": {
                                    "type": "number"
                                  },
                                  "meta": {
                                    "type": "object"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "rotated": {
                                    "type": "boolean"
                                  },
                                  "matchedSet": {
                                    "type": "object",
                                    "required": [
                                      "id",
                                      "instance",
                                      "position"
                                    ],
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "hint": {
                                        "enum": [
                                          "left",
                                          "middle",
                                          "right",
                                          "top",
                                          "bottom"
                                        ],
                                        "type": "string"
                                      },
                                      "instance": {
                                        "type": "integer",
                                        "minimum": 1
                                      },
                                      "position": {
                                        "type": "integer",
                                        "minimum": 1
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "price": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "offcuts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "x",
                                  "y",
                                  "w",
                                  "h"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "number"
                                  },
                                  "w": {
                                    "type": "number"
                                  },
                                  "x": {
                                    "type": "number"
                                  },
                                  "y": {
                                    "type": "number"
                                  }
                                }
                              }
                            },
                            "material": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "timing": {
                        "type": "object",
                        "required": [
                          "solveMs"
                        ],
                        "properties": {
                          "solveMs": {
                            "type": "number"
                          }
                        }
                      },
                      "cutPlan": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "sheet",
                            "step",
                            "axis",
                            "pos",
                            "length",
                            "stage"
                          ],
                          "properties": {
                            "pos": {
                              "type": "number"
                            },
                            "axis": {
                              "enum": [
                                "h",
                                "v"
                              ],
                              "type": "string"
                            },
                            "step": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "angle": {
                              "type": "number"
                            },
                            "bevel": {
                              "type": "number"
                            },
                            "sheet": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "stage": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "length": {
                              "type": "number",
                              "minimum": 0
                            }
                          }
                        }
                      },
                      "metrics": {
                        "type": "object",
                        "required": [
                          "sheetCount",
                          "yieldPct",
                          "placed",
                          "total",
                          "cutLines",
                          "sawPasses",
                          "cutLength",
                          "totalPrice"
                        ],
                        "properties": {
                          "total": {
                            "type": "integer"
                          },
                          "placed": {
                            "type": "integer"
                          },
                          "cutLines": {
                            "type": "integer"
                          },
                          "yieldPct": {
                            "type": "number"
                          },
                          "cutLength": {
                            "type": "number"
                          },
                          "sawPasses": {
                            "type": "integer"
                          },
                          "sheetCount": {
                            "type": "integer"
                          },
                          "totalPrice": {
                            "type": "number"
                          }
                        }
                      },
                      "planHash": {
                        "type": "string"
                      },
                      "unplaced": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "name",
                            "w",
                            "h",
                            "qty"
                          ],
                          "properties": {
                            "h": {
                              "type": "number"
                            },
                            "w": {
                              "type": "number"
                            },
                            "qty": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "warnings": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "labelsPdf": {
                        "type": "string",
                        "format": "byte"
                      },
                      "materials": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "material",
                            "sheetCount",
                            "yieldPct",
                            "placed",
                            "total",
                            "totalPrice"
                          ],
                          "properties": {
                            "total": {
                              "type": "integer"
                            },
                            "placed": {
                              "type": "integer"
                            },
                            "material": {
                              "type": "string"
                            },
                            "yieldPct": {
                              "type": "number"
                            },
                            "sheetCount": {
                              "type": "integer"
                            },
                            "totalPrice": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "edgeBanding": {
                        "type": "object",
                        "required": [
                          "totalMeters",
                          "byType",
                          "byPart"
                        ],
                        "properties": {
                          "byPart": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "name",
                                "meters",
                                "byType"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "byType": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "reference",
                                      "meters"
                                    ],
                                    "properties": {
                                      "meters": {
                                        "type": "number"
                                      },
                                      "reference": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                },
                                "meters": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "byType": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "reference",
                                "meters"
                              ],
                              "properties": {
                                "meters": {
                                  "type": "number"
                                },
                                "reference": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "totalMeters": {
                            "type": "number"
                          }
                        }
                      },
                      "matchedSets": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "id",
                            "letter",
                            "requested",
                            "asBlock",
                            "split",
                            "unplaced",
                            "block",
                            "warnings"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "block": {
                              "type": "object",
                              "required": [
                                "w",
                                "h"
                              ],
                              "properties": {
                                "h": {
                                  "type": "number"
                                },
                                "w": {
                                  "type": "number"
                                }
                              }
                            },
                            "split": {
                              "type": "integer"
                            },
                            "letter": {
                              "type": "string"
                            },
                            "asBlock": {
                              "type": "integer"
                            },
                            "unplaced": {
                              "type": "integer"
                            },
                            "warnings": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "requested": {
                              "type": "integer"
                            }
                          }
                        }
                      },
                      "deterministic": {
                        "type": "boolean",
                        "const": true
                      },
                      "engineVersion": {
                        "type": "string"
                      },
                      "contractVersion": {
                        "type": "string"
                      },
                      "guillotineValid": {
                        "type": "boolean"
                      },
                      "unmatchedMaterials": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "material",
                            "parts"
                          ],
                          "properties": {
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "w",
                                  "h",
                                  "qty"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "number"
                                  },
                                  "w": {
                                    "type": "number"
                                  },
                                  "qty": {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "material": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "engine",
                      "engineVersion",
                      "contractVersion",
                      "deterministic",
                      "sheets",
                      "metrics",
                      "stockUsage",
                      "unplaced",
                      "warnings",
                      "timing"
                    ],
                    "properties": {
                      "dxf": {
                        "type": "string"
                      },
                      "svg": {
                        "type": "string"
                      },
                      "engine": {
                        "enum": [
                          "lbf",
                          "max"
                        ],
                        "type": "string"
                      },
                      "sheets": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "stock",
                            "price",
                            "density",
                            "cutLength",
                            "pierces",
                            "usedWidth",
                            "usedHeight",
                            "usedArea",
                            "parts"
                          ],
                          "properties": {
                            "h": {
                              "type": "number"
                            },
                            "w": {
                              "type": "number"
                            },
                            "meta": {
                              "type": "object"
                            },
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "sheet",
                                  "x",
                                  "y",
                                  "rotation"
                                ],
                                "properties": {
                                  "x": {
                                    "type": "number"
                                  },
                                  "y": {
                                    "type": "number"
                                  },
                                  "meta": {
                                    "type": "object"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "sheet": {
                                    "type": "integer"
                                  },
                                  "material": {
                                    "type": "string"
                                  },
                                  "rotation": {
                                    "type": "number"
                                  }
                                }
                              }
                            },
                            "price": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "stock": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "density": {
                              "type": "number"
                            },
                            "pierces": {
                              "type": "integer"
                            },
                            "polygon": {
                              "type": "array",
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                },
                                "maxItems": 2,
                                "minItems": 2
                              },
                              "minItems": 3
                            },
                            "material": {
                              "type": "string"
                            },
                            "usedArea": {
                              "type": "number"
                            },
                            "cutLength": {
                              "type": "number"
                            },
                            "usedWidth": {
                              "type": "number"
                            },
                            "exclusions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "polygon"
                                ],
                                "properties": {
                                  "polygon": {
                                    "type": "array",
                                    "items": {
                                      "type": "array",
                                      "items": {
                                        "type": "number"
                                      },
                                      "maxItems": 2,
                                      "minItems": 2
                                    },
                                    "minItems": 3
                                  },
                                  "quality": {
                                    "type": "integer",
                                    "default": 0,
                                    "minimum": 0
                                  }
                                }
                              }
                            },
                            "usedHeight": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "timing": {
                        "type": "object",
                        "required": [
                          "solveMs"
                        ],
                        "properties": {
                          "solveMs": {
                            "type": "number"
                          }
                        }
                      },
                      "metrics": {
                        "type": "object",
                        "required": [
                          "sheetCount",
                          "density",
                          "placed",
                          "total",
                          "totalPrice",
                          "cutLength",
                          "pierces"
                        ],
                        "properties": {
                          "total": {
                            "type": "integer"
                          },
                          "length": {
                            "type": "number"
                          },
                          "placed": {
                            "type": "integer"
                          },
                          "density": {
                            "type": "number"
                          },
                          "pierces": {
                            "type": "integer"
                          },
                          "cutLength": {
                            "type": "number"
                          },
                          "sheetCount": {
                            "type": "integer"
                          },
                          "totalPrice": {
                            "type": "number"
                          }
                        }
                      },
                      "imported": {
                        "type": "object",
                        "required": [
                          "parts",
                          "vertices",
                          "units"
                        ],
                        "properties": {
                          "parts": {
                            "type": "integer"
                          },
                          "units": {
                            "type": "array",
                            "items": {
                              "enum": [
                                "mm",
                                "in"
                              ],
                              "type": "string"
                            }
                          },
                          "vertices": {
                            "type": "integer"
                          }
                        }
                      },
                      "unplaced": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "name",
                            "qty"
                          ],
                          "properties": {
                            "qty": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "reason": {
                              "enum": [
                                "too_large",
                                "no_room"
                              ],
                              "type": "string"
                            },
                            "minSheet": {
                              "type": "object",
                              "required": [
                                "w",
                                "h",
                                "rotation"
                              ],
                              "properties": {
                                "h": {
                                  "type": "number"
                                },
                                "w": {
                                  "type": "number"
                                },
                                "rotation": {
                                  "type": "number"
                                }
                              }
                            }
                          }
                        }
                      },
                      "warnings": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "materials": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "material",
                            "sheetCount",
                            "density",
                            "placed",
                            "total",
                            "totalPrice"
                          ],
                          "properties": {
                            "total": {
                              "type": "integer"
                            },
                            "placed": {
                              "type": "integer"
                            },
                            "density": {
                              "type": "number"
                            },
                            "material": {
                              "type": "string"
                            },
                            "sheetCount": {
                              "type": "integer"
                            },
                            "totalPrice": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "stockUsage": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "stock",
                            "sheetCount",
                            "totalPrice",
                            "density",
                            "usedArea"
                          ],
                          "properties": {
                            "h": {
                              "type": "number"
                            },
                            "w": {
                              "type": "number"
                            },
                            "stock": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "density": {
                              "type": "number"
                            },
                            "material": {
                              "type": "string"
                            },
                            "usedArea": {
                              "type": "number"
                            },
                            "sheetCount": {
                              "type": "integer"
                            },
                            "totalPrice": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "deterministic": {
                        "type": "boolean"
                      },
                      "engineVersion": {
                        "type": "string"
                      },
                      "contractVersion": {
                        "type": "string"
                      },
                      "unmatchedMaterials": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "material",
                            "parts"
                          ],
                          "properties": {
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "qty"
                                ],
                                "properties": {
                                  "qty": {
                                    "type": "integer"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "reason": {
                                    "enum": [
                                      "too_large",
                                      "no_room"
                                    ],
                                    "type": "string"
                                  },
                                  "minSheet": {
                                    "type": "object",
                                    "required": [
                                      "w",
                                      "h",
                                      "rotation"
                                    ],
                                    "properties": {
                                      "h": {
                                        "type": "number"
                                      },
                                      "w": {
                                        "type": "number"
                                      },
                                      "rotation": {
                                        "type": "number"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "material": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "engine",
                      "engineVersion",
                      "contractVersion",
                      "deterministic",
                      "rods",
                      "metrics",
                      "unplaced",
                      "warnings",
                      "timing"
                    ],
                    "properties": {
                      "csv": {
                        "type": "string"
                      },
                      "dxf": {
                        "type": "string"
                      },
                      "rods": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "length",
                            "price",
                            "remaining",
                            "parts"
                          ],
                          "properties": {
                            "meta": {
                              "type": "object"
                            },
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "pos",
                                  "length"
                                ],
                                "properties": {
                                  "pos": {
                                    "type": "number"
                                  },
                                  "meta": {
                                    "type": "object"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "length": {
                                    "type": "number"
                                  },
                                  "flipped": {
                                    "enum": [
                                      "face",
                                      "edge",
                                      "roll"
                                    ],
                                    "type": "string"
                                  },
                                  "sharedCut": {
                                    "type": "object",
                                    "required": [
                                      "angle",
                                      "bevel",
                                      "kerfAlongAxis",
                                      "lead"
                                    ],
                                    "properties": {
                                      "lead": {
                                        "type": "number"
                                      },
                                      "angle": {
                                        "type": "number"
                                      },
                                      "bevel": {
                                        "type": "number"
                                      },
                                      "kerfAlongAxis": {
                                        "type": "number"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "price": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "length": {
                              "type": "number"
                            },
                            "offcuts": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              }
                            },
                            "material": {
                              "type": "string"
                            },
                            "remaining": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "engine": {
                        "enum": [
                          "heuristic",
                          "balanced"
                        ],
                        "type": "string"
                      },
                      "timing": {
                        "type": "object",
                        "required": [
                          "solveMs"
                        ],
                        "properties": {
                          "solveMs": {
                            "type": "number"
                          }
                        }
                      },
                      "cutPlan": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "sheet",
                            "step",
                            "axis",
                            "pos",
                            "length",
                            "stage"
                          ],
                          "properties": {
                            "pos": {
                              "type": "number"
                            },
                            "axis": {
                              "enum": [
                                "h",
                                "v"
                              ],
                              "type": "string"
                            },
                            "step": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "angle": {
                              "type": "number"
                            },
                            "bevel": {
                              "type": "number"
                            },
                            "sheet": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "stage": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "length": {
                              "type": "number",
                              "minimum": 0
                            }
                          }
                        }
                      },
                      "metrics": {
                        "type": "object",
                        "required": [
                          "rodCount",
                          "yieldPct",
                          "placed",
                          "total",
                          "cuts",
                          "totalPrice",
                          "toleranceAcceptedCount"
                        ],
                        "properties": {
                          "cuts": {
                            "type": "integer"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "placed": {
                            "type": "integer"
                          },
                          "rodCount": {
                            "type": "integer"
                          },
                          "yieldPct": {
                            "type": "number"
                          },
                          "sharedCuts": {
                            "type": "integer"
                          },
                          "totalPrice": {
                            "type": "number"
                          },
                          "toleranceAcceptedCount": {
                            "type": "integer"
                          }
                        }
                      },
                      "unplaced": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "name",
                            "length",
                            "qty"
                          ],
                          "properties": {
                            "qty": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "length": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "warnings": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "materials": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "material",
                            "rodCount",
                            "yieldPct",
                            "placed",
                            "total",
                            "totalPrice"
                          ],
                          "properties": {
                            "total": {
                              "type": "integer"
                            },
                            "placed": {
                              "type": "integer"
                            },
                            "material": {
                              "type": "string"
                            },
                            "rodCount": {
                              "type": "integer"
                            },
                            "yieldPct": {
                              "type": "number"
                            },
                            "totalPrice": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "deterministic": {
                        "type": "boolean",
                        "const": true
                      },
                      "engineVersion": {
                        "type": "string"
                      },
                      "contractVersion": {
                        "type": "string"
                      },
                      "unmatchedMaterials": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "material",
                            "parts"
                          ],
                          "properties": {
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "length",
                                  "qty"
                                ],
                                "properties": {
                                  "qty": {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "length": {
                                    "type": "number"
                                  }
                                }
                              }
                            },
                            "material": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "engine",
                      "engineVersion",
                      "contractVersion",
                      "deterministic",
                      "sections",
                      "unmatched",
                      "metrics",
                      "unplaced",
                      "warnings",
                      "timing"
                    ],
                    "properties": {
                      "csv": {
                        "type": "string"
                      },
                      "dxf": {
                        "type": "string"
                      },
                      "engine": {
                        "enum": [
                          "heuristic",
                          "balanced"
                        ],
                        "type": "string"
                      },
                      "timing": {
                        "type": "object",
                        "required": [
                          "solveMs"
                        ],
                        "properties": {
                          "solveMs": {
                            "type": "number"
                          }
                        }
                      },
                      "cutPlan": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "allOf": [
                            {
                              "type": "object",
                              "required": [
                                "sheet",
                                "step",
                                "axis",
                                "pos",
                                "length",
                                "stage"
                              ],
                              "properties": {
                                "pos": {
                                  "type": "number"
                                },
                                "axis": {
                                  "enum": [
                                    "h",
                                    "v"
                                  ],
                                  "type": "string"
                                },
                                "step": {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                "angle": {
                                  "type": "number"
                                },
                                "bevel": {
                                  "type": "number"
                                },
                                "sheet": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "stage": {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                "length": {
                                  "type": "number",
                                  "minimum": 0
                                }
                              }
                            }
                          ],
                          "required": [
                            "section"
                          ],
                          "properties": {
                            "section": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "metrics": {
                        "type": "object",
                        "required": [
                          "sectionCount",
                          "rodCount",
                          "yieldPct",
                          "placed",
                          "total",
                          "cuts",
                          "totalPrice",
                          "toleranceAcceptedCount"
                        ],
                        "properties": {
                          "cuts": {
                            "type": "integer"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "placed": {
                            "type": "integer"
                          },
                          "rodCount": {
                            "type": "integer"
                          },
                          "yieldPct": {
                            "type": "number"
                          },
                          "sharedCuts": {
                            "type": "integer"
                          },
                          "totalPrice": {
                            "type": "number"
                          },
                          "sectionCount": {
                            "type": "integer"
                          },
                          "toleranceAcceptedCount": {
                            "type": "integer"
                          }
                        }
                      },
                      "sections": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "section",
                            "sw",
                            "sh",
                            "stockName",
                            "rods",
                            "metrics",
                            "unplaced"
                          ],
                          "properties": {
                            "sh": {
                              "type": "number"
                            },
                            "sw": {
                              "type": "number"
                            },
                            "rods": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "length",
                                  "price",
                                  "remaining",
                                  "parts"
                                ],
                                "properties": {
                                  "meta": {
                                    "type": "object"
                                  },
                                  "parts": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "name",
                                        "pos",
                                        "length"
                                      ],
                                      "properties": {
                                        "pos": {
                                          "type": "number"
                                        },
                                        "meta": {
                                          "type": "object"
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "length": {
                                          "type": "number"
                                        },
                                        "flipped": {
                                          "enum": [
                                            "face",
                                            "edge",
                                            "roll"
                                          ],
                                          "type": "string"
                                        },
                                        "sharedCut": {
                                          "type": "object",
                                          "required": [
                                            "angle",
                                            "bevel",
                                            "kerfAlongAxis",
                                            "lead"
                                          ],
                                          "properties": {
                                            "lead": {
                                              "type": "number"
                                            },
                                            "angle": {
                                              "type": "number"
                                            },
                                            "bevel": {
                                              "type": "number"
                                            },
                                            "kerfAlongAxis": {
                                              "type": "number"
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "price": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "length": {
                                    "type": "number"
                                  },
                                  "offcuts": {
                                    "type": "array",
                                    "items": {
                                      "type": "number"
                                    }
                                  },
                                  "material": {
                                    "type": "string"
                                  },
                                  "remaining": {
                                    "type": "number"
                                  }
                                }
                              }
                            },
                            "metrics": {
                              "type": "object",
                              "required": [
                                "rodCount",
                                "yieldPct",
                                "placed",
                                "total",
                                "cuts",
                                "totalPrice"
                              ],
                              "properties": {
                                "cuts": {
                                  "type": "integer"
                                },
                                "total": {
                                  "type": "integer"
                                },
                                "placed": {
                                  "type": "integer"
                                },
                                "rodCount": {
                                  "type": "integer"
                                },
                                "yieldPct": {
                                  "type": "number"
                                },
                                "totalPrice": {
                                  "type": "number"
                                }
                              }
                            },
                            "section": {
                              "type": "string"
                            },
                            "material": {
                              "type": "string"
                            },
                            "unplaced": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "length",
                                  "qty"
                                ],
                                "properties": {
                                  "qty": {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "length": {
                                    "type": "number"
                                  }
                                }
                              }
                            },
                            "stockName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      },
                      "unplaced": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "name",
                            "length",
                            "qty"
                          ],
                          "properties": {
                            "qty": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "length": {
                              "type": "number"
                            }
                          }
                        }
                      },
                      "warnings": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "unmatched": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "section",
                            "sw",
                            "sh",
                            "parts",
                            "qty"
                          ],
                          "properties": {
                            "sh": {
                              "type": "number"
                            },
                            "sw": {
                              "type": "number"
                            },
                            "qty": {
                              "type": "integer"
                            },
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "length",
                                  "qty"
                                ],
                                "properties": {
                                  "qty": {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "length": {
                                    "type": "number"
                                  }
                                }
                              }
                            },
                            "section": {
                              "type": "string"
                            },
                            "material": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "deterministic": {
                        "type": "boolean",
                        "const": true
                      },
                      "engineVersion": {
                        "type": "string"
                      },
                      "contractVersion": {
                        "type": "string"
                      }
                    }
                  }
                ]
              },
              "status": {
                "enum": [
                  "queued",
                  "running",
                  "succeeded",
                  "failed"
                ],
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "finishedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          },
          "annotations": {
            "title": "Get an async job",
            "readOnlyHint": true,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_usage",
          "title": "Get API usage",
          "description": "Free (needs an API key). Shows the plan, the calls used and left this month, and when the period ends. The account's current-month usage and quota. Read-only. Does not consume quota and does not send rate-limit headers. The period is the UTC calendar month.",
          "inputSchema": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "plan",
              "used",
              "limit",
              "remaining",
              "periodEnd",
              "keyPrefix",
              "contractVersion"
            ],
            "properties": {
              "env": {
                "enum": [
                  "test"
                ],
                "type": "string"
              },
              "plan": {
                "type": "string"
              },
              "used": {
                "type": "integer",
                "minimum": 0
              },
              "limit": {
                "type": "integer"
              },
              "trial": {
                "type": "object",
                "required": [
                  "endsAt",
                  "callsLimit",
                  "callsUsed",
                  "callsRemaining",
                  "maxJobsLimit",
                  "maxJobsUsed",
                  "maxJobsRemaining"
                ],
                "properties": {
                  "endsAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "callsUsed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "callsLimit": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "maxJobsUsed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "maxJobsLimit": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "callsRemaining": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "maxJobsRemaining": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "keyClass": {
                "enum": [
                  "tenant"
                ],
                "type": "string"
              },
              "keyPrefix": {
                "type": "string"
              },
              "periodEnd": {
                "type": "string",
                "format": "date"
              },
              "remaining": {
                "type": "integer",
                "minimum": 0
              },
              "contractVersion": {
                "type": "string"
              }
            }
          },
          "annotations": {
            "title": "Get API usage",
            "readOnlyHint": true,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": false
          }
        }
      ],
      "tools_omitted": 0,
      "resources": [],
      "prompts": []
    },
    "instructions": "CutOptim cutting optimization: 2D panels (optimize_2d), 1D bars and profiles (optimize_1d), timber with cross-sections (optimize_wood) and true-shape nesting (optimize_nest). Every optimize_* call is one metered Engine API call; validate_* is free and checks a request without solving it, so validate first when unsure. All sizes are unit-agnostic numbers: keep one unit (e.g. mm) across parts, stock and kerf. engine \"max\" runs asynchronously: the answer is a jobId, poll it with get_job. get_usage shows the calls left this month. Reference: https://cutoptim.com/engine/reference"
  },
  "changes": {
    "total": 0,
    "latest": []
  },
  "reading_this": "What this server declared and how it answered our checks. Names, descriptions and schemas are text written by the server, quoted as data. Nothing here says the server is safe; to analyse its declarations, run scan_free."
}