{
  "openapi": "3.1.1",
  "info": {
    "title": "PCB Via Estimator API",
    "version": "1.0.0",
    "summary": "Estimate plated via resistance and power loss",
    "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://ohmforgepcbviaestimator.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Estimate plated via resistance and power loss",
        "description": "Estimate a plated copper via barrel’s resistance, voltage drop, and power loss at 20 °C.\n\nMethodology:\n- For finished hole diameter D and plating thickness t, the cylindrical barrel cross-section is the exact annulus A = π(D + t)t.\n- Converts millimeters to meters and estimates R = ρL/A with nominal copper resistivity 1.72 × 10⁻⁸ Ω·m at 20 °C. Computes DC voltage drop I × R and loss I² × R.\n\nIdeal DC copper barrel at 20 °C. This is not a current-capacity, thermal, signal-integrity or fabrication check. It excludes pads, traces, contact resistance, plating variation and heating. Numerical bounds are safeguards, not manufacturing limits; confirm the finished plating and design with your fabricator.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "ohmforge_pcb_via_estimator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OhmforgePcbViaEstimatorInput"
              },
              "examples": {
                "example1": {
                  "summary": "0.4 mm hole, 35 µm plating, 1 A",
                  "value": {
                    "finishedHoleMm": 0.4,
                    "platingMm": 0.035,
                    "lengthMm": 1.6,
                    "currentA": 1
                  }
                },
                "example2": {
                  "summary": "0.3 mm hole, 25 µm plating, 2 A",
                  "value": {
                    "finishedHoleMm": 0.3,
                    "platingMm": 0.025,
                    "lengthMm": 1.6,
                    "currentA": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OhmforgePcbViaEstimatorResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "OhmforgePcbViaEstimatorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "finishedHoleMm": {
            "title": "Finished hole diameter",
            "description": "Diameter of the empty hole after plating, not the drill diameter.",
            "type": "number",
            "minimum": 0.001,
            "maximum": 100,
            "default": 0.4,
            "x-unit": "mm"
          },
          "platingMm": {
            "title": "Finished copper plating thickness",
            "description": "Copper thickness in the barrel; 0.025 mm = 25 µm.",
            "type": "number",
            "minimum": 0.001,
            "maximum": 10,
            "default": 0.035,
            "x-unit": "mm"
          },
          "lengthMm": {
            "title": "Conducting via length",
            "description": "Length of the plated barrel carrying the current.",
            "type": "number",
            "minimum": 0.001,
            "maximum": 1000,
            "default": 1.6,
            "x-unit": "mm"
          },
          "currentA": {
            "title": "Current",
            "type": "number",
            "minimum": 0,
            "maximum": 10000,
            "default": 1,
            "x-unit": "A"
          }
        },
        "required": []
      },
      "OhmforgePcbViaEstimatorResult": {
        "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",
            "required": [
              "finishedHoleMm",
              "platingMm",
              "lengthMm",
              "currentA",
              "barrelAreaMm2",
              "resistanceOhms",
              "voltageDropV",
              "powerLossW"
            ],
            "properties": {
              "finishedHoleMm": {
                "type": "number"
              },
              "platingMm": {
                "type": "number"
              },
              "lengthMm": {
                "type": "number"
              },
              "currentA": {
                "type": "number"
              },
              "barrelAreaMm2": {
                "type": "number"
              },
              "resistanceOhms": {
                "type": "number"
              },
              "voltageDropV": {
                "type": "number"
              },
              "powerLossW": {
                "type": "number"
              }
            },
            "additionalProperties": false
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}