Skip to main content
Glama
Islam0953
by Islam0953

lab-units-mcp

An MCP server that converts clinical blood-test results between conventional and SI units, and resolves lab-marker names — including abbreviations and non-English labels — to a canonical analyte.

I built the first version of this while wiring up a pipeline that ingested blood panels from several different labs. Half of them reported glucose in mg/dL and half in mmol/L, HbA1c came back as either a percentage or mmol/mol, and the marker names were inconsistent across providers and languages. The conversion factors are not complicated, but keeping them correct and in one place — with the name-matching that has to happen before you can convert anything — was worth pulling out into a small, testable tool. This is that tool, exposed over MCP so an assistant can call it directly.

It is a units-and-naming utility. It does not interpret results, does not carry reference ranges, and is not medical advice.

Tools

Tool

What it does

convert_lab_value

Convert a value between two units of the same analyte (e.g. glucose mg/dLmmol/L, HbA1c %mmol/mol).

identify_analyte

Resolve a printed label (ЛПНП, A1c, glu) to a canonical analyte and its available units.

list_analytes

List every supported analyte with its canonical unit and unit options.

The analyte can be passed by name or by a common synonym in English or Russian, so glucose, Glucose and глюкоза all resolve to the same marker.

Related MCP server: Unit Expert MCP

Supported analytes

Glucose, total/HDL/LDL cholesterol, triglycerides, creatinine, urea, total bilirubin, uric acid, calcium, iron, magnesium, phosphate, haemoglobin, HbA1c, albumin, total protein, C-reactive protein, testosterone, estradiol, cortisol, free T4, free T3, vitamin D (25-OH), vitamin B12, folate, insulin, sodium, potassium and chloride.

Conversion factors are the standard molar-mass-derived values used across clinical laboratories. HbA1c uses the NGSP ↔ IFCC relationship (mmol/mol = (% − 2.152) × 10.931).

Install

npm install -g lab-units-mcp

Or run it without installing:

npx lab-units-mcp

Use it with Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "lab-units": {
      "command": "npx",
      "args": ["-y", "lab-units-mcp"]
    }
  }
}

There are no API keys and no network calls — everything runs locally.

Use it with the Claude Code CLI

claude mcp add lab-units -- npx -y lab-units-mcp

Examples

convert_lab_value  analyte="glucose"  value=99  from_unit="mg/dL"
  -> 99 mg/dL = 5.494 mmol/L (Glucose)

convert_lab_value  analyte="HbA1c"  value=5.7  from_unit="%"  to_unit="mmol/mol"
  -> 5.7 % = 38.79 mmol/mol (HbA1c)

identify_analyte   label="ЛПНП"
  -> ЛПНП -> LDL cholesterol (key: ldl_cholesterol); units: mmol/L, mg/dL

Develop

npm install
npm run build
npm start

License

MIT

Available Tools

3 tools
convert_lab_valueConvert a lab value between unitsA

Convert a single blood-chemistry result between conventional and SI units (e.g. glucose mg/dL <-> mmol/L, HbA1c % <-> mmol/mol). The analyte can be given by name or a common synonym in English or Russian. If to_unit is omitted and the analyte has exactly two units, it converts to the other one.

ParametersJSON Schema
NameRequiredDescriptionDefault
valueYesNumeric value to convert.
analyteYesAnalyte name or synonym, e.g. "glucose", "HbA1c", "глюкоза".
to_unitNoTarget unit. Optional when the analyte has only two units.
from_unitYesUnit the value is currently in, e.g. "mg/dL".

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses key behaviors: accepts synonyms, converts to the other unit if to_unit omitted and only two units exist. However, it does not describe error handling for unsupported analytes, analytes with more than two units when to_unit is omitted, or the output format. Some edge-case transparency is missing.

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

Conciseness5/5

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

The description is two sentences, front-loaded with the main purpose, and includes valuable examples without fluff. Every sentence adds necessary context about synonyms and optional conversion behavior. Perfectly concise.

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 relatively simple tool with a complete schema and no output schema, the description covers the core functionality, parameter intent, and special optional behavior. It only lacks explicit handling of error/edge cases (e.g., analytes with >2 units and omitted to_unit), which would make it fully complete. Given the simplicity, it is nearly sufficient.

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

Parameters4/5

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

The schema already documents all four parameters with 100% coverage, so the baseline is 3. The description adds value by explaining the optional to_unit behavior (converts to the other unit if exactly two units) and provides analyte examples including a Russian synonym, enriching the schema's context.

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?

The description clearly states the tool converts a single blood-chemistry result between conventional and SI units, with concrete examples (glucose mg/dL <-> mmol/L, HbA1c % <-> mmol/mol). This verb+resource scope distinguishes it from siblings like identify_analyte and list_analytes, which serve different purposes.

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?

The description gives clear context: use for single-result conversions between unit systems, with support for English/Russian synonym lookup and optional to_unit behavior. It does not explicitly exclude alternatives, but the focus on conversion and the sibling names make the intended use obvious. Lacks explicit 'when not to use' guidance.

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

identify_analyteIdentify a lab marker from its labelA

Resolve a lab-report label — including an abbreviation or a non-English name — to a canonical analyte, and report the units it can be expressed in. Useful for normalising results parsed from labs that use local naming conventions.

ParametersJSON Schema
NameRequiredDescriptionDefault
labelYesThe label as printed on the report, e.g. "ЛПНП", "A1c", "glu".

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations provided, the description is the sole source of behavioral disclosure. It clearly states the main behavior (resolve label, report units) and adds specifics like handling abbreviations and non-English names. However, it does not disclose potential edge cases such as ambiguous labels, return format, or error behavior, which leaves some uncertainty for an agent.

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

Conciseness5/5

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

The description is two sentences, front-loaded with the core action ('Resolve a lab-report label...'), and every clause adds value. There is no repetition of schema information, and the structure is clear and scannable.

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?

The tool is simple (1 param, no output schema), and the description covers the main purpose and a use case. It does not explicitly describe the return shape beyond mentioning units, but for an identification tool this is largely adequate. With no output schema, a bit more detail on the return value would improve completeness, but it remains sufficient for basic invocation.

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

Parameters4/5

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

The single parameter 'label' is already described in the schema with examples. The description adds semantic value by clarifying that the label can be an abbreviation or non-English name and is a 'lab-report label', reinforcing the local-naming normalization use case. This goes beyond the schema's basic example list.

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?

The description clearly states the tool's function: resolving a lab-report label (including abbreviations and non-English names) to a canonical analyte and reporting its possible units. This distinguishes it from the sibling tools convert_lab_value (which converts values) and list_analytes (which lists analytes), making the purpose unambiguous.

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?

The description provides clear context on when to use the tool ('useful for normalising results parsed from labs that use local naming conventions'), which implies the appropriate scenario. It does not explicitly name alternatives or exclusions, but the sibling tool names and the described purpose implicitly differentiate it from conversion and listing tools.

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

list_analytesList supported analytesA

List every analyte this server can convert, with its display name, canonical unit and the full set of units available for conversion.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the return content (display name, canonical unit, full unit set) but does not explicitly state that it is a read-only operation or mention any side effects. For a listing tool, this is adequate and adds specific behavioral details beyond simply saying 'list analytes.'

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

Conciseness5/5

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

The description is a single, front-loaded sentence that packs necessary information without waste. It states the action, scope, and return fields efficiently.

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

Completeness5/5

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

Given the tool's simplicity (no params, no output schema), the description fully explains what the tool returns and for what purpose. It covers the essential info an agent needs to use it correctly, and no additional context about pagination or ordering is required for a tool of this nature.

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

Parameters4/5

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

The tool has zero parameters, so the baseline is 4. There are no parameter semantics to describe, and the description correctly avoids inventing any. The schema coverage is vacuously 100%, so nothing is missing.

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?

The description uses the specific verb 'List' with a clear resource ('every analyte this server can convert') and specifies the returned fields (display name, canonical unit, full unit set). It clearly distinguishes from sibling tools like convert_lab_value and identify_analyte, which handle conversion and identification rather than listing.

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

Usage Guidelines3/5

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

The description implies the tool is used when you need a comprehensive list of convertible analytes and their units, but it does not explicitly reference sibling tools or state when not to use it. The context signals include sibling names, but the description itself lacks direct comparison or exclusion statements.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedconvert_lab_value
    • First observedidentify_analyte
    • First observedlist_analytes

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a distinct purpose: convert_lab_value performs conversions, identify_analyte resolves labels to canonical analytes, and list_analytes enumerates supported analytes. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: convert_lab_value, identify_analyte, list_analytes. The verbs and nouns are specific and predictable, making the API intuitive.

Tool Count5/5

Three tools is an ideal size for a focused unit conversion server. Each tool adds essential functionality without redundancy or bloat, and the count is well within the recommended 3-15 range.

Completeness5/5

The server provides a complete workflow: list analytes to discover what is available, identify an analyte from a lab report, and convert values between units. There are no obvious missing operations for its stated purpose.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Verified unit conversion and dimensional analysis for AI agents. 190+ units, 31 domain formulas (clinical, physics, aerospace, SRE), physical constants with uncertainty propagation. Refuses invalid conversions structurally: the tool that won't convert mg to mL and knows the difference between torque and energy.
    AGPL 3.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables drug terminology standardization and name normalization via RxNav API, supporting drug name search, generic/brand name conversion, ATC classification, and ingredient lookup.
    GPL 3.0
  • F
    license
    A
    quality
    C
    maintenance
    Enables interaction with synthetic NIH-style clinical research data through tools for searching publications, querying patient metadata, analyzing AAA measurements, and retrieving protocol guidance.
    5
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Islam0953/mcp-lab-units'

If you have feedback or need assistance with the MCP directory API, please join our Discord server