{
  "openapi": "3.1.1",
  "info": {
    "title": "Laser Kerf Test \u0026 Press-Fit Gauge API",
    "version": "1.0.0",
    "summary": "Cut a kerf test coupon and a press-fit comb, then turn your measurement into kerf and fit settings.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://kerfwisekerftest.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Cut a kerf test coupon and a press-fit comb, then turn your measurement into kerf and fit settings.",
        "description": "Generate a kerf test frame (an opening divided into equal pieces) and a press-fit comb with engraved slot offsets for your material thickness. After cutting, push the pieces to one side, measure the gap and enter it: the tool divides it by the number of cuts and tells you the kerf compensation and the fit clearance to use for finger-joint boxes, slots and sliding lids.\n\nMethodology:\n- The kerf frame has an opening of n × piece width, divided into n pieces by n − 1 cuts. Including the two sides of the opening, n + 1 cuts cross the strip and each removes one kerf, so pushed together the pieces leave a gap of (n + 1) × kerf: kerf = gap ÷ (n + 1).\n- Comb slot k is cut at a nominal width of thickness + offset k; the laser widens it by one kerf. If slot k gives the fit you want, a slot that is kerf-compensated by the measured kerf needs a fit clearance of offset k + kerf to feel the same.\n- Cut the test without kerf compensation. Numbers are engraved with a single-stroke font on the engrave layer. SVG files use millimetres (width/height in mm, 1 user unit = 1 mm) with one group per layer: cut (red #e4002b), score (blue #0067c5), engrave (black) and labels (grey). DXF R12 uses the same layers, millimetres, y up.\n\nLaser cutters and CNC routers can start fires and release harmful fumes: never leave the machine unattended, use extraction, and never cut PVC, vinyl or other chlorine-containing plastics. Sizes, kerf and fit are starting points — check them with a test cut and follow your machine maker's safety rules.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "kerfwise_kerf_test",
        "x-owner-app": "kerfwise",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KerfwiseKerfTestInput"
              },
              "examples": {
                "example1": {
                  "summary": "Test coupon for 3 mm plywood",
                  "value": {
                    "thickness": 3
                  }
                },
                "example2": {
                  "summary": "Evaluate: 1.65 mm gap over 10 pieces, slot 3 fits",
                  "value": {
                    "thickness": 3,
                    "gap": 1.65,
                    "slot": 3
                  }
                },
                "example3": {
                  "summary": "Acrylic 5 mm with finer steps",
                  "value": {
                    "thickness": 5,
                    "fitStart": -0.2,
                    "fitStep": 0.05,
                    "fitCount": 9,
                    "pieces": 12
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KerfwiseKerfTestResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "KerfwiseKerfTestInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "thickness": {
            "title": "Material thickness (mm)",
            "type": "number",
            "minimum": 0.5,
            "maximum": 30,
            "default": 3
          },
          "pieces": {
            "title": "Pieces in the kerf frame",
            "type": "integer",
            "minimum": 3,
            "maximum": 30,
            "default": 10
          },
          "pieceWidth": {
            "title": "Piece width (mm)",
            "type": "number",
            "minimum": 3,
            "maximum": 50,
            "default": 10
          },
          "fitStart": {
            "title": "First comb slot: thickness plus (mm)",
            "type": "number",
            "minimum": -5,
            "maximum": 5,
            "default": -0.3
          },
          "fitStep": {
            "title": "Comb slot step (mm)",
            "type": "number",
            "minimum": 0.01,
            "maximum": 2,
            "default": 0.1
          },
          "fitCount": {
            "title": "Comb slots",
            "type": "integer",
            "minimum": 2,
            "maximum": 15,
            "default": 7
          },
          "gap": {
            "title": "Measured gap after pushing the pieces together (mm, 0 = not yet)",
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "default": 0
          },
          "slot": {
            "title": "Comb slot with the fit you want (0 = not yet)",
            "type": "integer",
            "minimum": 0,
            "maximum": 15,
            "default": 0
          },
          "sheetWidth": {
            "title": "Sheet or laser bed width (mm, 0 = no sheet)",
            "description": "With a sheet size the parts are nested onto as many sheets as needed; 0 lays every part out in one drawing.",
            "type": "number",
            "minimum": 0,
            "maximum": 5000,
            "default": 0
          },
          "sheetHeight": {
            "title": "Sheet or laser bed height (mm, 0 = no sheet)",
            "type": "number",
            "minimum": 0,
            "maximum": 5000,
            "default": 0
          },
          "spacing": {
            "title": "Gap between parts (mm)",
            "description": "For CNC routing use at least the cutter diameter.",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 4
          },
          "labels": {
            "title": "Part names on a separate label layer",
            "type": "boolean",
            "default": true
          },
          "paper": {
            "title": "PDF pages",
            "type": "string",
            "enum": [
              "fit",
              "a3",
              "a4",
              "a5",
              "a6",
              "b5",
              "letter",
              "legal",
              "tabloid",
              "halfletter"
            ],
            "default": "fit"
          }
        },
        "required": []
      },
      "KerfwiseKerfTestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kerf",
              "cuts",
              "slots",
              "chosenOffset",
              "suggestedKerf",
              "suggestedFit",
              "sheets",
              "parts",
              "pdfPages",
              "warnings",
              "files",
              "openInApp"
            ],
            "properties": {
              "kerf": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "cuts": {
                "type": "integer"
              },
              "slots": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "number",
                    "offset",
                    "width"
                  ],
                  "properties": {
                    "number": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "number"
                    },
                    "width": {
                      "type": "number"
                    }
                  }
                }
              },
              "chosenOffset": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "suggestedKerf": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "suggestedFit": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "sheets": {
                "type": "integer"
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "label",
                    "name",
                    "width",
                    "height",
                    "sheet"
                  ],
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "width": {
                      "type": "number"
                    },
                    "height": {
                      "type": "number"
                    },
                    "sheet": {
                      "type": "integer"
                    }
                  }
                }
              },
              "pdfPages": {
                "type": "integer"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "files": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "pdf"
                ],
                "properties": {
                  "pdf": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "artifactId",
                      "filename",
                      "mime",
                      "bytes",
                      "sha256",
                      "path"
                    ],
                    "properties": {
                      "artifactId": {
                        "type": "string"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mime": {
                        "type": "string"
                      },
                      "bytes": {
                        "type": "integer"
                      },
                      "sha256": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Download path on the same site (valid for about 2 hours)."
                      }
                    }
                  }
                }
              },
              "openInApp": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}