{
  "openapi": "3.1.1",
  "info": {
    "title": "Sizewise Money Stack API",
    "version": "1.0.0",
    "summary": "How tall is a million dollars? Banknotes as a stack, by weight and on pallets.",
    "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://sizewisemoneystack.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "How tall is a million dollars? Banknotes as a stack, by weight and on pallets.",
        "description": "Turns an amount of money into banknotes: how many notes, how high the stack, what it weighs, the area laid flat and how many EUR-pallets it fills, compared with real objects. US dollar and euro note sizes from the issuers, or your own notes.\n\nMethodology:\n- Notes = amount ÷ note value, rounded up. Stack height = notes × thickness; mass = notes × mass per note; flat area = notes × length × width.\n- US notes: 6.14 × 2.61 in, 0.0043 in thick, about 1 g each. Check: a stack one mile high holds 14.7 million notes, matching the U.S. Currency Education Program’s “more than 14.5 million”.\n- Pallets: the EUR-pallet’s 1.2 × 0.8 m deck (Wikidata Q1281598) is filled with notes in the best row arrangement, stacked to the chosen load height.\n\nBanknotes in circulation are worn and slightly thicker; real bundles add bands and air. The ECB publishes no thickness or mass for euro notes: those values are your assumption.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "sizewise_money_stack",
        "x-owner-app": "sizewise",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SizewiseMoneyStackInput"
              },
              "examples": {
                "example1": {
                  "summary": "One million dollars in $100 notes",
                  "value": {
                    "amount": "1 million",
                    "currency": "usd",
                    "denomination": 100
                  }
                },
                "example2": {
                  "summary": "One trillion dollars",
                  "value": {
                    "amount": "1 trillion",
                    "currency": "usd",
                    "denomination": 100
                  }
                },
                "example3": {
                  "summary": "Half a million euros in €50 notes",
                  "value": {
                    "amount": "500000",
                    "currency": "eur",
                    "denomination": 50,
                    "thicknessMm": 0.11
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SizewiseMoneyStackResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "SizewiseMoneyStackInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "amount": {
            "title": "Amount",
            "description": "For example 10000, 1 million, 2.5 billion or 1e12.",
            "type": "string",
            "maxLength": 60,
            "default": "1 million"
          },
          "currency": {
            "title": "Notes",
            "type": "string",
            "enum": [
              "usd",
              "eur",
              "custom"
            ],
            "default": "usd"
          },
          "denomination": {
            "title": "Value of one note",
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000000,
            "default": 100
          },
          "thicknessMm": {
            "title": "Thickness of one note (euro and own notes)",
            "type": "number",
            "minimum": 0.03,
            "maximum": 1,
            "default": 0.11,
            "x-unit": "mm"
          },
          "massG": {
            "title": "Mass of one note (own notes, optional)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 0,
            "x-unit": "g"
          },
          "noteLengthMm": {
            "title": "Note length (own notes)",
            "type": "number",
            "minimum": 10,
            "maximum": 400,
            "default": 150,
            "x-unit": "mm"
          },
          "noteWidthMm": {
            "title": "Note width (own notes)",
            "type": "number",
            "minimum": 10,
            "maximum": 400,
            "default": 70,
            "x-unit": "mm"
          },
          "loadHeightM": {
            "title": "Load height on a pallet",
            "type": "number",
            "minimum": 0.1,
            "maximum": 2.5,
            "default": 1,
            "x-unit": "m"
          }
        },
        "required": []
      },
      "SizewiseMoneyStackResult": {
        "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"
              }
            }
          }
        }
      }
    }
  }
}