Health
Calculate the serum Anion Gap (AG) to classify metabolic acidosis. Standard formula AG = Na⁺ − Cl⁻ − HCO₃⁻ (mmol/L), or AG = Na⁺ + K⁺ − Cl⁻ − HCO₃⁻ with optional potassium. A high AG (≈ >12, or >20 with K⁺) indicates accumulation of unmeasured anions (lactic acidosis, ketoacidosis, renal failure, and toxins such as methanol/ethylene glycol, salicylates — mnemonic GOLD-MARK). A normal AG (8–12) during metabolic acidosis points to a hyperchloremic (normal-anion-gap) acidosis: diarrhea, renal tubular acidosis, saline resuscitation. A low AG (<3–6) is usually hypoalbuminemia, also hypercalcemia/hypermagnesemia, lithium, cationic IgG paraproteins, or bromide pseudo-hyperchloraemia. Optional albumin correction AG_corrected = AG + 2.5 × (4.0 − albumin g/dL) avoids missing a high-AG acidosis in hypoalbuminemia. Derived from Kraut CJASN 2007, Figge 1998, and MDCalc. Interpret with blood gas and full clinical context. Not medical advice.
Call this tool from your code in three languages.
curl -X POST 'http://127.0.0.1:3003/en/api/tools/anion-gap-calculator' \
-H 'Content-Type: application/json' \
-d '{"includePotassium":false,"sodium":140,"chloride":104,"bicarbonate":10,"potassium":0,"albumin":0,"decimalPlaces":1}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST http://127.0.0.1:3003/en/api/tools/anion-gap-calculator| Name | Type | Required | Description |
|---|---|---|---|
| includePotassium | checkbox | No | Use AG = Na⁺ + K⁺ − Cl⁻ − HCO₃⁻. Reference range shifts up to roughly 10–20 mmol/L. |
| sodium | number | Yes | Serum sodium (mmol/L). Physiologic range ~120–160. |
| chloride | number | Yes | Serum chloride (mmol/L). Physiologic range ~80–130. |
| bicarbonate | number | Yes | Serum bicarbonate / total CO₂ (mmol/L). Physiologic range ~5–50. |
| potassium | number |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-anion-gap-calculator": {
"name": "anion-gap-calculator",
"description": "Calculate the serum Anion Gap (AG) to classify metabolic acidosis. Standard formula AG = Na⁺ − Cl⁻ − HCO₃⁻ (mmol/L), or AG = Na⁺ + K⁺ − Cl⁻ − HCO₃⁻ with optional potassium. A high AG (≈ >12, or >20 with K⁺) indicates accumulation of unmeasured anions (lactic acidosis, ketoacidosis, renal failure, and toxins such as methanol/ethylene glycol, salicylates — mnemonic GOLD-MARK). A normal AG (8–12) during metabolic acidosis points to a hyperchloremic (normal-anion-gap) acidosis: diarrhea, renal tubular acidosis, saline resuscitation. A low AG (<3–6) is usually hypoalbuminemia, also hypercalcemia/hypermagnesemia, lithium, cationic IgG paraproteins, or bromide pseudo-hyperchloraemia. Optional albumin correction AG_corrected = AG + 2.5 × (4.0 − albumin g/dL) avoids missing a high-AG acidosis in hypoalbuminemia. Derived from Kraut CJASN 2007, Figge 1998, and MDCalc. Interpret with blood gas and full clinical context. Not medical advice.",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=anion-gap-calculator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "anion-gap-calculator",
"arguments": {
"includePotassium": false,
"sodium": 140,
"chloride": 104,
"bicarbonate": 10,
"potassium": 0,
"albumin": 0,
"decimalPlaces": 1
}
}
}| Serum potassium (mmol/L). Required only when 'Include Potassium K⁺' is checked. |
| albumin | number | No | Serum albumin (g/dL). If provided, computes albumin-corrected AG: AG_corr = AG + 2.5 × (4.0 − albumin). |
| decimalPlaces | number | No | — |
JSON result
{
"key": {...},
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}Questions or issues? Contact [email protected]