{
  "openapi": "3.1.1",
  "info": {
    "title": "Sizewise Big Number Explainer API",
    "version": "1.0.0",
    "summary": "What does a googol, 2^64 or 8 billion really mean? Names, digits and counting time.",
    "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://sizewisebignumber.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "What does a googol, 2^64 or 8 billion really mean? Names, digits and counting time.",
        "description": "Explains any big number written as digits, words, scientific notation, powers or factorials: exact digits, scientific notation, the short- and long-scale names, how long counting to it takes, how high a stack of banknotes it makes and which famous numbers are close.\n\nMethodology:\n- Numbers are kept exact as big integers up to 20 000 digits (factorials up to 3 000! exactly, larger ones from the Stirling series); beyond that only the logarithm is kept.\n- Names follow the Conway–Wechsler system for 10^(3n+3) on the short scale (English, US) and 10^(6n) / 10^(6n+3) (-illion / -illiard) on the long scale used in most of continental Europe, with the traditional dictionary spellings from 10^48 to 10^60.\n- Counting time uses the Julian year of 365.25 days and the age of the universe from Planck 2018 (13.787 billion years). The banknote stack uses 0.0043 in (0.109 mm) per US note.\n\nNumber names beyond the dictionary ones are systematic constructions; dictionaries rarely list them.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "sizewise_big_number",
        "x-owner-app": "sizewise",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SizewiseBigNumberInput"
              },
              "examples": {
                "example1": {
                  "summary": "A googol",
                  "value": {
                    "number": "googol"
                  }
                },
                "example2": {
                  "summary": "Grains on a chessboard (2^64)",
                  "value": {
                    "number": "2^64"
                  }
                },
                "example3": {
                  "summary": "People on Earth",
                  "value": {
                    "number": "8,117,059,282"
                  }
                },
                "example4": {
                  "summary": "Shuffles of a card deck",
                  "value": {
                    "number": "52!"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SizewiseBigNumberResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "SizewiseBigNumberInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "number": {
            "title": "Number",
            "description": "For example 8 billion, 8117059282, 6.02e23, 3 × 10^8, 2^64, 52! or googol.",
            "type": "string",
            "maxLength": 200,
            "default": "googol"
          },
          "perSecond": {
            "title": "Counting speed",
            "type": "number",
            "minimum": 0.000001,
            "maximum": 1000000000000,
            "default": 1,
            "x-unit": "per second"
          }
        },
        "required": []
      },
      "SizewiseBigNumberResult": {
        "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"
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}