{
  "openapi": "3.1.1",
  "info": {
    "title": "Aquarium Volume and Weight API",
    "version": "1.0.0",
    "summary": "Real water litres and filled weight of a rectangular, bow-front, round or hexagonal tank.",
    "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://hearthaquariumvolume.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Real water litres and filled weight of a rectangular, bow-front, round or hexagonal tank.",
        "description": "Works out how much water an aquarium really holds after the glass, the gap below the rim, the substrate (with the water in its pores) and the decor, what the filled tank weighs with an estimate for the glass, and — if you want — how far the top board of the furniture bends under it.\n\nMethodology:\n- Inside size = outer size minus twice the glass (length, depth, diameter, width across flats) and minus one glass thickness in height. Footprint: rectangle; bow-front = rectangle plus a circular segment with the bow as its height (radius = c²/8b + b/2); cylinder = π·d²/4; regular hexagon = (√3/2)·w² with w the width across flats.\n- Real water = inside footprint × (water height − substrate depth) − decor volume + the water in the substrate pores (substrate volume × pore share). Water height = inside height − gap below the rim. US gallons = litres ÷ 3.785; UK gallons = litres ÷ 4.546.\n- Weight = water (0.997 kg/L fresh, 1.023 kg/L salt water at 25 °C) + glass (area of the bottom and side panes, open top, × thickness × 2500 kg/m³) + dry substrate + decor. Cabinets, lids, lights, filters and the stand are not included.\n- Board check (optional): the top board between its supports as a simply supported beam with Kerfwise’s shelf-sag engine (Euler–Bernoulli, long-term creep per EN 1995-1-1, typical moduli). A tank shorter than the span is a centred partial load, entered as the uniform plus mid-span point load with the same mid-span deflection; a tank longer than the span puts only span ÷ tank length of its weight on the span. Default limit L/600: glass tanks need a flat top.\n\nVolumes and weights are estimates from your measurements. The board check is not a structural approval; follow the tank maker’s instructions for the stand and floor.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "hearth_aquarium_volume",
        "x-owner-app": "hearth",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HearthAquariumVolumeInput"
              },
              "examples": {
                "example1": {
                  "summary": "80 × 35 × 40 cm tank (112 litres outside)",
                  "value": {
                    "shape": "rectangular",
                    "lengthCm": 80,
                    "depthCm": 35,
                    "heightCm": 40,
                    "glassMm": 6,
                    "gapCm": 2.5,
                    "substrateCm": 5,
                    "porosity": 0.4,
                    "substrateDensity": 1.6,
                    "decorLitres": 4,
                    "decorDensity": 2.5,
                    "water": "fresh"
                  }
                },
                "example2": {
                  "summary": "Bow-front 120 cm on a chipboard sideboard",
                  "value": {
                    "shape": "bowfront",
                    "lengthCm": 120,
                    "depthCm": 40,
                    "heightCm": 55,
                    "bowCm": 10,
                    "glassMm": 10,
                    "gapCm": 3,
                    "substrateCm": 6,
                    "porosity": 0.4,
                    "substrateDensity": 1.6,
                    "decorLitres": 12,
                    "decorDensity": 2.5,
                    "water": "fresh",
                    "checkStand": true,
                    "standSpanCm": 140,
                    "standThicknessMm": 19,
                    "standMaterial": "pb-p2",
                    "standLimit": "L/600"
                  }
                },
                "example3": {
                  "summary": "Round 60 cm column, marine",
                  "value": {
                    "shape": "cylinder",
                    "lengthCm": 60,
                    "heightCm": 70,
                    "glassMm": 8,
                    "gapCm": 3,
                    "substrateCm": 4,
                    "porosity": 0.45,
                    "substrateDensity": 1.4,
                    "decorLitres": 15,
                    "decorDensity": 2.2,
                    "water": "marine"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HearthAquariumVolumeResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "HearthAquariumVolumeInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "shape": {
            "title": "Tank shape",
            "type": "string",
            "enum": [
              "rectangular",
              "bowfront",
              "cylinder",
              "hexagon"
            ],
            "default": "rectangular"
          },
          "lengthCm": {
            "title": "Length (cm) — cylinder: diameter, hexagon: width across flats",
            "type": "number",
            "minimum": 5,
            "maximum": 500,
            "default": 80
          },
          "depthCm": {
            "title": "Depth (cm) — bow-front: at the sides",
            "description": "Not used for round and hexagonal tanks.",
            "type": "number",
            "minimum": 5,
            "maximum": 300,
            "default": 35
          },
          "heightCm": {
            "title": "Height (cm)",
            "type": "number",
            "minimum": 5,
            "maximum": 300,
            "default": 40
          },
          "bowCm": {
            "title": "Bow-front: extra depth at the centre (cm)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 0
          },
          "glassMm": {
            "title": "Glass thickness (mm)",
            "description": "The dimensions are outer dimensions. Enter 0 if you measured inside.",
            "type": "number",
            "minimum": 0,
            "maximum": 40,
            "default": 6
          },
          "gapCm": {
            "title": "Gap from the water surface to the rim (cm)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 2.5
          },
          "substrateCm": {
            "title": "Average substrate depth (cm)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 5
          },
          "porosity": {
            "title": "Water share of the substrate (0–0.6)",
            "description": "Gravel and sand hold about 0.35–0.45 of their volume as water.",
            "type": "number",
            "minimum": 0,
            "maximum": 0.6,
            "default": 0.4
          },
          "substrateDensity": {
            "title": "Substrate weight (kg per litre, dry)",
            "description": "Gravel and sand about 1.5–1.7; lightweight plant soil about 0.8–1.1.",
            "type": "number",
            "minimum": 0.1,
            "maximum": 3,
            "default": 1.6
          },
          "decorLitres": {
            "title": "Rocks, wood and decor under water (litres)",
            "type": "number",
            "minimum": 0,
            "maximum": 5000,
            "default": 4
          },
          "decorDensity": {
            "title": "Decor weight (kg per litre)",
            "description": "Stone about 2.5; soaked wood about 1.",
            "type": "number",
            "minimum": 0.1,
            "maximum": 5,
            "default": 2.5
          },
          "water": {
            "title": "Water",
            "type": "string",
            "enum": [
              "fresh",
              "marine"
            ],
            "default": "fresh"
          },
          "checkStand": {
            "title": "Check the top board of the furniture",
            "type": "boolean",
            "default": false
          },
          "standSpanCm": {
            "title": "Board span between its supports (cm)",
            "type": "number",
            "minimum": 5,
            "maximum": 500,
            "default": 80
          },
          "standDepthCm": {
            "title": "Board depth (cm, 0 = tank depth)",
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "default": 0
          },
          "standThicknessMm": {
            "title": "Board thickness (mm)",
            "type": "number",
            "minimum": 3,
            "maximum": 100,
            "default": 19
          },
          "standMaterial": {
            "title": "Board material",
            "type": "string",
            "enum": [
              "pb-p2",
              "pb-p4",
              "pb-p6",
              "mdf",
              "osb3",
              "ply-birch",
              "ply-birch-cross",
              "oak-red",
              "oak-white",
              "maple-sugar",
              "maple-red",
              "beech",
              "birch-yellow",
              "cherry",
              "walnut",
              "ash-white",
              "poplar",
              "douglas-fir",
              "pine-white"
            ],
            "default": "pb-p2"
          },
          "standLimit": {
            "title": "Allowed sag",
            "type": "string",
            "enum": [
              "L/240",
              "L/300",
              "L/360",
              "L/600"
            ],
            "default": "L/600"
          }
        },
        "required": []
      },
      "HearthAquariumVolumeResult": {
        "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",
            "additionalProperties": false,
            "required": [
              "shape",
              "outer",
              "inner",
              "waterHeightCm",
              "substrateLitres",
              "poreWaterLitres",
              "decorLitres",
              "waterLitres",
              "usGallons",
              "ukGallons",
              "weights",
              "glassAreaM2",
              "floorLoadKgPerM2",
              "stand"
            ],
            "properties": {
              "shape": {
                "type": "string"
              },
              "outer": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "footprintCm2",
                  "litres",
                  "spanLengthCm",
                  "depthCm"
                ],
                "properties": {
                  "footprintCm2": {
                    "type": "number"
                  },
                  "litres": {
                    "type": "number"
                  },
                  "spanLengthCm": {
                    "type": "number"
                  },
                  "depthCm": {
                    "type": "number"
                  }
                }
              },
              "inner": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "footprintCm2",
                  "litresToRim",
                  "heightCm"
                ],
                "properties": {
                  "footprintCm2": {
                    "type": "number"
                  },
                  "litresToRim": {
                    "type": "number"
                  },
                  "heightCm": {
                    "type": "number"
                  }
                }
              },
              "waterHeightCm": {
                "type": "number"
              },
              "substrateLitres": {
                "type": "number"
              },
              "poreWaterLitres": {
                "type": "number"
              },
              "decorLitres": {
                "type": "number"
              },
              "waterLitres": {
                "type": "number"
              },
              "usGallons": {
                "type": "number"
              },
              "ukGallons": {
                "type": "number"
              },
              "weights": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "waterKg",
                  "glassKg",
                  "substrateKg",
                  "decorKg",
                  "totalKg"
                ],
                "properties": {
                  "waterKg": {
                    "type": "number"
                  },
                  "glassKg": {
                    "type": "number"
                  },
                  "substrateKg": {
                    "type": "number"
                  },
                  "decorKg": {
                    "type": "number"
                  },
                  "totalKg": {
                    "type": "number"
                  }
                }
              },
              "glassAreaM2": {
                "type": "number"
              },
              "floorLoadKgPerM2": {
                "type": "number"
              },
              "stand": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "material",
                  "spanMm",
                  "depthMm",
                  "thicknessMm",
                  "uniformKgPerM",
                  "pointKg",
                  "deflectionMm",
                  "limit",
                  "limitMm",
                  "passes",
                  "disclaimer"
                ],
                "properties": {
                  "material": {
                    "type": "string"
                  },
                  "spanMm": {
                    "type": "number"
                  },
                  "depthMm": {
                    "type": "number"
                  },
                  "thicknessMm": {
                    "type": "number"
                  },
                  "uniformKgPerM": {
                    "type": "number"
                  },
                  "pointKg": {
                    "type": "number"
                  },
                  "deflectionMm": {
                    "type": "number"
                  },
                  "limit": {
                    "type": "string"
                  },
                  "limitMm": {
                    "type": "number"
                  },
                  "passes": {
                    "type": "boolean"
                  },
                  "disclaimer": {
                    "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"
              }
            }
          }
        }
      }
    }
  }
}