{
  "openapi": "3.1.1",
  "info": {
    "title": "Ohmforge L-Network Impedance Matching (Smith Chart) API",
    "version": "1.0.0",
    "summary": "Match a load to 50 Ω with two parts: every L-network solution, part values, Q and a Smith chart.",
    "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://ohmforgeimpedancematching.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Match a load to 50 Ω with two parts: every L-network solution, part values, Q and a Smith chart.",
        "description": "Enter a load impedance R + jX, the source or line impedance and the frequency. The tool returns every lossless two-element L-network that matches them — shunt-first and series-first, with inductor and capacitor values — the nodal Q, the VSWR ≤ 2 bandwidth and a Smith chart that shows each match path from the load to the centre. Each solution is verified by evaluating the network's input impedance.\n\nMethodology:\n- Analytic L-section design after Pozar §5.1. Shunt-first (shunt part across the load, series part towards the source): B = (X_L ± √(R_L/Z0)·√(R_L² + X_L² − Z0·R_L)) / (R_L² + X_L²), then the series reactance cancels what is left; possible when |Z_L|² ≥ Z0·R_L (always for R_L > Z0). Series-first (series part next to the load, shunt part towards the source): X = ±√(R_L(Z0 − R_L)) − X_L, B = ±√((Z0 − R_L)/R_L)/Z0; possible when R_L < Z0.\n- Parts at f: X > 0 → L = X/ω, X < 0 → C = −1/(ωX); B > 0 → C = B/ω, B < 0 → L = −1/(ωB).\n- Each solution is checked by computing the input impedance of the finished network with complex arithmetic and once more by parsing its network expression with Ohmforge's impedance calculator.\n- Nodal Q = |X|/R at the node between the two parts. The VSWR ≤ 2 band is found by bisection on |Γin(f)| = 1/3, with the load modelled as R_L plus the inductor or capacitor that has X_L at the design frequency.\n- The Smith chart is normalised to Z0; series parts move along circles of constant resistance, shunt parts along circles of constant conductance.\n\nIdeal, lossless parts: real inductors have resistance and self-resonance, capacitors have ESR and ESL, and PCB pads add parasitics that matter above a few hundred MHz. A real load's impedance changes with frequency differently from the simple R + L or R + C model used for the bandwidth. Tune on the bench with a VNA.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "ohmforge_impedance_matching",
        "x-owner-app": "ohmforge",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OhmforgeImpedanceMatchingInput"
              },
              "examples": {
                "example1": {
                  "summary": "Pozar example 5.1: 200 − j100 Ω to 100 Ω at 500 MHz",
                  "value": {
                    "loadR": 200,
                    "loadX": -100,
                    "z0": 100,
                    "frequencyMHz": 500
                  }
                },
                "example2": {
                  "summary": "Low-impedance load 10 + j5 Ω to 50 Ω at 100 MHz",
                  "value": {
                    "loadR": 10,
                    "loadX": 5,
                    "z0": 50,
                    "frequencyMHz": 100
                  }
                },
                "example3": {
                  "summary": "Short 433 MHz antenna 12.5 − j60 Ω to 50 Ω",
                  "value": {
                    "loadR": 12.5,
                    "loadX": -60,
                    "z0": 50,
                    "frequencyMHz": 433.92
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OhmforgeImpedanceMatchingResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "OhmforgeImpedanceMatchingInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "loadR": {
            "title": "Load resistance R",
            "type": "number",
            "minimum": 0.000001,
            "maximum": 1000000000,
            "default": 200,
            "x-unit": "Ω"
          },
          "loadX": {
            "title": "Load reactance X",
            "description": "Positive = inductive, negative = capacitive.",
            "type": "number",
            "minimum": -1000000000,
            "maximum": 1000000000,
            "default": -100,
            "x-unit": "Ω"
          },
          "z0": {
            "title": "Source / line impedance Z0",
            "description": "Real impedance to match to, usually 50 Ω.",
            "type": "number",
            "minimum": 0.001,
            "maximum": 1000000,
            "default": 100,
            "x-unit": "Ω"
          },
          "frequencyMHz": {
            "title": "Frequency",
            "type": "number",
            "minimum": 0.000001,
            "maximum": 1000000,
            "default": 500,
            "x-unit": "MHz"
          }
        },
        "required": []
      },
      "OhmforgeImpedanceMatchingResult": {
        "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": [
              "loadR",
              "loadX",
              "z0",
              "frequencyHz",
              "solutions"
            ],
            "additionalProperties": false,
            "properties": {
              "loadR": {
                "type": "number"
              },
              "loadX": {
                "type": "number"
              },
              "z0": {
                "type": "number"
              },
              "frequencyHz": {
                "type": "number"
              },
              "gammaLoad": {
                "type": "number"
              },
              "vswrLoad": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "loadModel": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "type": "string"
                  },
                  "value": {
                    "type": "number"
                  }
                }
              },
              "solutions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "topology": {
                      "type": "string",
                      "enum": [
                        "shunt-first",
                        "series-first"
                      ]
                    },
                    "series": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "L",
                            "C",
                            "none"
                          ]
                        },
                        "value": {
                          "type": "number",
                          "description": "H or F."
                        },
                        "reactance": {
                          "type": "number",
                          "description": "Series: X in Ω. Shunt: B in S."
                        }
                      }
                    },
                    "shunt": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "L",
                            "C",
                            "none"
                          ]
                        },
                        "value": {
                          "type": "number",
                          "description": "H or F."
                        },
                        "reactance": {
                          "type": "number",
                          "description": "Series: X in Ω. Shunt: B in S."
                        }
                      }
                    },
                    "q": {
                      "type": "number"
                    },
                    "zInReal": {
                      "type": "number"
                    },
                    "zInImag": {
                      "type": "number"
                    },
                    "bandLowHz": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "bandHighHz": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "expression": {
                      "type": "string",
                      "description": "Network for the Ohmforge impedance calculator (load modelled as R plus L or C)."
                    }
                  }
                }
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}