{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.prime_factorization.agent.input.json",
  "title": "Prime factorization — agent input",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "n"
      ],
      "properties": {
        "mode": {
          "const": "factorize"
        },
        "n": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000000000
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*-?[0-9]{1,13}\\s*$"
            }
          ]
        }
      }
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "n"
      ],
      "properties": {
        "mode": {
          "const": "is_prime"
        },
        "n": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000000000
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*-?[0-9]{1,13}\\s*$"
            }
          ]
        }
      }
    }
  ],
  "description": "Exact bounded prime factorization and primality with sorted factors/exponents, complete counts and empty-product handling for1.. Mode-discriminated agent contract. Named fields are canonical; a/b are legacy share-URL aliases. (calculation_version 1.0.1)"
}
