API & MCP
Everything a person can do on Solution, Gas Law & pH Calculator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://prooflinesolutioncalculator.usefulweb.site/api/v1/calculate– run Solution, Gas Law & pH CalculatorGET https://prooflinesolutioncalculator.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Solution, Gas Law & pH Calculator
One calculator for the everyday quantities of solution chemistry, with units you type yourself (250 mL, 0.1 M, 25 °C, 1 atm): molarity from mass and volume or any of the three from the other two, dilutions with C1·V1 = C2·V2, mass, moles and particles of a formula, the ideal gas law solved for any variable with Dalton partial pressures of a mixture, and the pH of strong and weak acids and bases (exact quadratic and full charge balance) and of buffers (Henderson–Hasselbalch checked against the exact result). Part of the Proofline math notebook.
| Field | Type | Default | Description |
|---|---|---|---|
mode | select (molarity, dilution, amount, gas, ph) | "molarity" | Calculation |
formula | text | — | Formula of the solute or gas. Gives the molar mass for conversions between mass and moles (molarity, amount, gas). |
molarMass | number | — | Molar mass (instead of a formula) |
solute | text | — | Solute (mass or amount). Molarity: leave exactly one of solute, volume and concentration empty — that one is calculated. |
volume | text | — | Volume of solution. Molarity: the final volume of the solution in L, mL, µL, dm3 or cm3. |
concentration | text | — | Concentration. Molarity: M, mM, µM, mol/L or g/L. |
c1 | text | — | C1 (stock concentration) |
v1 | text | — | V1 (volume of stock) |
c2 | text | — | C2 (final concentration) |
v2 | text | — | V2 (final volume). Dilution: leave exactly one of C1, V1, C2 and V2 empty. |
quantity | text | — | Quantity. A mass (g), an amount (mol) or a number of particles (1.5e23 molecules). |
pressure | text | — | Pressure. Pa, kPa, bar, atm, mmHg, torr or psi. Gas law: leave exactly one of pressure, volume, amount and temperature empty. |
gasVolume | text | — | Volume of gas. L, mL or m3. |
temperature | text | — | Temperature. K, °C or °F. |
gasAmount | text | — | Amount of gas. mol, or a mass with the formula. Leave empty to use the sum of the mixture. |
mixture | textarea | — | Gas mixture (optional). Each gas with an amount or a mass: mole fractions and partial pressures (Dalton’s law). |
solutionType | select (strong-acid, strong-base, weak-acid, weak-base, buffer) | "weak-acid" | Solution |
phConcentration | text | — | Acid or base concentration. pH: the concentration of the acid or base; for a buffer the concentration of the weak acid HA. M, mM or mol/L. |
constant | text | — | Ka, pKa, Kb or pKb. A bare number is Ka for acids and buffers and Kb for bases; write pKa 4.76 or Kb 1.8e-5 to be explicit. |
conjugate | text | — | Conjugate base concentration (buffer) |
equivalents | integer | 1 | H⁺ or OH⁻ per formula unit (strong). For example 2 for Ba(OH)2. |
Example request
Molarity of 5.844 g NaCl in 250 mL
curl -X POST https://prooflinesolutioncalculator.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"mode":"molarity","formula":"NaCl","solute":"5.844 g","volume":"250 mL"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://prooflinesolutioncalculator.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
proofline_solution_calculator - Local stdio connector:
node src/mcp-stdio.ts --tool=proofline-solution-calculator
{
"mcpServers": {
"proofline-solution-calculator": { "type": "http", "url": "https://prooflinesolutioncalculator.usefulweb.site/mcp" }
}
}