Skip to main content
Glama

Nutricity calculators

calculate_ldl_cholesterol

Read-onlyIdempotent

Estimate LDL cholesterol from total cholesterol, HDL and triglycerides via the Friedewald (default), Martin-Hopkins or Sampson/NIH method, in mg/dL or mmol/L. Friedewald is suppressed (result null, reliable false) when triglycerides exceed 400 mg/dL — use martin-hopkins or sampson for high triglycerides. Returns the LDL estimate, the formula used, the triglyceride divisor and non-HDL cholesterol.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "total": "<total>",
      "hdl": "<hdl>",
      "triglycerides": "<triglycerides>"
    },
    "name": "calculate_ldl_cholesterol"
  }
}

Input Schema

NameRequiredDescriptionDefault
hdlYesHDL cholesterol
unitNoUnit of all three inputs: mg (mg/dL) or mmol (mmol/L). Default mg
totalYesTotal cholesterol
formulaNoEstimation method: friedewald (default; suppressed when TG > 400 mg/dL), martin-hopkins (strata-specific divisor, better at low LDL / high TG), or sampson (closed-form, valid to TG 800 mg/dL)
triglyceridesYesTriglycerides

Output Schema

NameRequiredDescriptionDefault
unitYesUnit of result and nonHdl
factorYesTriglyceride divisor used to estimate VLDL-C (null for Sampson)
nonHdlYesNon-HDL cholesterol (total − HDL)
resultYesEstimated LDL cholesterol in the requested unit, or null when suppressed (Friedewald with TG > 400 mg/dL)
formulaYesThe formula actually applied
reliableYesWhether the chosen formula is valid for these inputs
suppressedReasonYesWhy result is null: 'triglycerides' (TG outside the validated range) or 'non-positive' (estimate <= 0); null when a result is returned

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish readOnly and idempotent, so the bar is lower; the description still adds real behavior by disclosing the Friedewald suppression condition and that the result becomes null with reliable=false. The tradeoff profile of each method (low LDL / high TG, validity to TG 800) is also surfaced.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences with the method/unit scope front-loaded and the suppression caveat immediately after. The closing sentence enumerating return fields largely duplicates the existing output schema and is the one piece that does not fully earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter, fully documented read-only calculator with an output schema, this covers inputs, method selection, failure mode, and unit assumptions adequately. Nothing required to invoke it correctly is missing, though behavior for out-of-range or zero-valued inputs is not addressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and both enums already carry detailed descriptions, so the schema does the heavy lifting. The description restates the formula options and the 400 mg/dL threshold rather than adding syntax, defaults, or edge-case handling beyond them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Estimate LDL cholesterol'), names the exact inputs consumed and the three supported formulas, and scopes units. It is distinguishable from nearby calculators such as calculate_non_hdl_cholesterol because the resource and computation are explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit alternative-selection rule: Friedewald is suppressed above 400 mg/dL triglycerides, so use Martin-Hopkins or Sampson instead. This is clear conditional guidance, though it only covers formula choice rather than when this calculator is preferred over sibling calculators.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources