Elysia Tools Docs
EN
Language
ZHESPTRUFRDEEN
Back to site
Browse tools

Health

Urine Anion Gap (UAG) Calculator

Calculate the Urine Anion Gap (UAG) to differentiate causes of normal-anion-gap (hyperchloremic) metabolic acidosis: UAG = (U_Na + U_K) − U_Cl, in mmol/L. The UAG is an inverse surrogate for urinary NH₄⁺ excretion. A negative UAG (typically −20 to −50) indicates appropriate high NH₄⁺ excretion → extrarenal (GI) bicarbonate loss (diarrhea, fistulae, ureteral diversions). A positive/high UAG indicates low NH₄⁺ excretion → renal tubular acidosis (distal/type 1, type 4 hypoaldosteronism, proximal/type 2 variable). Reference range ≈ 0 to +40 mmol/L. Caveats: unreliable with unmeasured urine anions (ketoacidosis, toluene/hippurate, D-lactate) or when urine sodium < 25 mmol/L (use urine osmolar gap instead). Derived from Batlle CJASN 2012, Ito 2025, Bonner AJKD 2025. Interpret with blood gas and full clinical context. Not medical advice.

json· JSON resultOpen tool

Quick start

Call this tool from your code in three languages.

cURL
curl -X POST 'https://api.elysiatools.com/en/api/tools/anion-gap-renal' \
  -H 'Content-Type: application/json' \
  -d '{"urineSodium":25,"urinePotassium":35,"urineChloride":120,"decimalPlaces":1}'

API reference

Send a POST request with your inputs as JSON. File parameters require a separate upload first.

Endpoint

HTTP
POST https://api.elysiatools.com/en/api/tools/anion-gap-renal

Parameters

NameTypeRequiredDescription
urineSodiumnumberYesUrine sodium U_Na (mmol/L). Must be ≥0. Reliability drops below 25 mmol/L.
urinePotassiumnumberYesUrine potassium U_K (mmol/L). Must be ≥0.
urineChloridenumberYesUrine chloride U_Cl (mmol/L). Must be ≥0.
decimalPlacesnumberNo—

Response format

JSON result

JSON
{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}

MCP integration

Add this tool to your Model Context Protocol server so AI agents can list and call it.

Server configuration

Add this block to your MCP client configuration:

mcp.json
{
  "mcpServers": {
    "elysiatools-anion-gap-renal": {
      "name": "anion-gap-renal",
      "description": "Calculate the Urine Anion Gap (UAG) to differentiate causes of normal-anion-gap (hyperchloremic) metabolic acidosis: UAG = (U_Na + U_K) − U_Cl, in mmol/L. The UAG is an inverse surrogate for urinary NH₄⁺ excretion. A negative UAG (typically −20 to −50) indicates appropriate high NH₄⁺ excretion → extrarenal (GI) bicarbonate loss (diarrhea, fistulae, ureteral diversions). A positive/high UAG indicates low NH₄⁺ excretion → renal tubular acidosis (distal/type 1, type 4 hypoaldosteronism, proximal/type 2 variable). Reference range ≈ 0 to +40 mmol/L. Caveats: unreliable with unmeasured urine anions (ketoacidosis, toluene/hippurate, D-lactate) or when urine sodium < 25 mmol/L (use urine osmolar gap instead). Derived from Batlle CJASN 2012, Ito 2025, Bonner AJKD 2025. Interpret with blood gas and full clinical context. Not medical advice.",
      "baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=anion-gap-renal",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

List available tools

After connecting to the SSE endpoint, list the exposed tools:

tools/list
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

Call this tool

Invoke the tool by its id, passing arguments built from its parameters:

tools/call
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "anion-gap-renal",
    "arguments": {
  "urineSodium": 25,
  "urinePotassium": 35,
  "urineChloride": 120,
  "decimalPlaces": 1
}
  }
}
Browse toolsOpen tool

© 2026 Elysia Tools. Developer documentation.

Back to siteBrowse tools
Chain multiple tools in one session with a comma-separated toolId list, e.g. /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp (max 20).

Questions or issues? Contact [email protected]