{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.modulo.agent.input.json",
  "title": "Euclidean remainder / modular inverse — agent input",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "a",
        "modulus"
      ],
      "properties": {
        "mode": {
          "const": "remainder"
        },
        "a": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
            }
          ]
        },
        "modulus": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
            }
          ]
        }
      }
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "a",
        "modulus"
      ],
      "properties": {
        "mode": {
          "const": "inverse"
        },
        "a": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
            }
          ]
        },
        "modulus": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
            }
          ]
        }
      }
    }
  ],
  "description": "Exact Euclidean remainder/quotient and modular inverse for signed integers; canonical Bézout coefficients satisfy the original-input identity.. Mode-discriminated agent contract. Named fields are canonical; a/b are legacy share-URL aliases. (calculation_version 1.1.2)"
}
