Skip to main content
Glama

update_lab_result

Idempotent

Update fields on an existing lab result. use: correcting a result already logged, most often its collection date. Send only the fields that change.

SELECTOR, exactly one of id | date | date+marker | draw_id:

  • id: one marker's row. Any editable field may change.

  • draw_id: every result sharing that draw_id at once, unambiguous by construction. Draw-level fields only: new_date, panel_name_new, lab_name, fasting_status, report_date.

  • date (optionally narrowed by panel_name): every result from that draw at once, but ONLY when exactly one draw exists on that date (see AMBIGUITY). Draw-level fields only.

  • date + marker (marker-name substring, case-insensitive, optionally narrowed by panel_name): one marker's row, same as id. More than one marker matching on that date -> error with candidate IDs. Per-marker fields (result_value, result_unit, result_comparator, marker_name, flag, notes): id or date+marker only.

AMBIGUITY: a bare date (optionally + panel_name) selector that would match more than one physical draw is rejected with nothing changed: an explicit draw_id from one source plus legacy rows with none, two distinct draw_ids, or two differently-named legacy sources on the same day. The error names every draw found; retry with draw_id, marker, or a narrower panel_name.

FASTING: fasting_status changes to 'fasting' or 'non_fasting' only when the user explicitly states it for that draw; never infer from time of day or a notes mention. 'unknown' is a valid explicit value too, for undoing a mistaken confirmation.

NOTES: changing result_value, result_unit or result_comparator regenerates the "Reported as <9 IU/mL"-style note from the new value/unit/comparator, replacing only a note it previously auto-generated; any other free text in notes survives. Pass notes yourself only to add or change unrelated free text; it is folded in alongside the regenerated line, not overwriting it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "update_lab_result"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoLab result ID: one marker row.
dateNoCollection date of the draw, YYYY-MM-DD. See SELECTOR.
flagNoNew lab flag: "H", "L", "HH", "LL", or "A". Per-marker.
notesNoNew notes. Per-marker; see NOTES.
markerNoWith date: case-insensitive marker-name substring (e.g. "LDL") narrowing to one marker row. Ignored with id or draw_id.
draw_idNoOpaque label grouping one visit's results, normalized server-side. See SELECTOR. Ignored when id is given.
lab_nameNoNew lab name, e.g. "Quest Diagnostics", "LabCorp".
new_dateNoNew collection date, YYYY-MM-DD; the main reason to call this tool.
panel_nameNoNarrows a date (or date+marker) selector to one panel in that draw, e.g. "Lipid Panel". Ignored with id.
marker_nameNoNew marker name. Per-marker.
report_dateNoNew report/result date, separate from the collection date, YYYY-MM-DD.
result_unitNoNew unit, e.g. "mg/dL". Per-marker; see NOTES.
result_valueNoNew numeric result value. Per-marker; see NOTES.
fasting_statusNoNew fasting status for the whole draw. See FASTING.
panel_name_newNoNew panel name.
result_comparatorNoNew comparator for a reporting-limit result (e.g. "<9"), or "none" to clear it back to an exact value. Per-marker; see NOTES.

Output Schema

NameRequiredDescriptionDefault
resultYesHuman-readable result text returned by the tool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"Collection date of the draw to update. Format: YYYY-MM-DD. Selects every result from that draw (see AMBIGUITY above), or (with marker) one row. Alternative to id/draw_id."New value: +"Collection date of the draw, YYYY-MM-DD. See SELECTOR."
    • changedInput schema / properties / draw_id / description
      Previous value: -"Opaque label of your choosing grouping a set of results from one visit, normalized server-side. Selects every result sharing that label, unambiguous by construction. Alternative to id/date. Ignored when id is given."New value: +"Opaque label grouping one visit's results, normalized server-side. See SELECTOR. Ignored when id is given."
    • changedInput schema / properties / fasting_status / description
      Previous value: -"New fasting status for the whole draw. See FASTING above. Optional, omit if not changing. Works with any selector."New value: +"New fasting status for the whole draw. See FASTING."
    • changedInput schema / properties / flag / description
      Previous value: -"New lab flag: \"H\", \"L\", \"HH\", \"LL\", or \"A\". Optional, omit if not changing. Only allowed when selecting by id or date+marker."New value: +"New lab flag: \"H\", \"L\", \"HH\", \"LL\", or \"A\". Per-marker."
    • changedInput schema / properties / id / description
      Previous value: -"Lab result ID. Selects a single marker row. Alternative to date/draw_id."New value: +"Lab result ID: one marker row."
    • changedInput schema / properties / lab_name / description
      Previous value: -"New lab name (e.g. \"Quest Diagnostics\", \"LabCorp\"). Optional, omit if not changing. Works with any selector."New value: +"New lab name, e.g. \"Quest Diagnostics\", \"LabCorp\"."
    • changedInput schema / properties / marker / description
      Previous value: -"Optional with date: marker-name substring, case-insensitive (e.g. \"LDL\"), narrowing the date selector to a single marker row so per-marker fields can be edited without an id. Ignored when id or draw_id is given."New value: +"With date: case-insensitive marker-name substring (e.g. \"LDL\") narrowing to one marker row. Ignored with id or draw_id."
    • changedInput schema / properties / marker_name / description
      Previous value: -"New marker name. Optional, omit if not changing. Only allowed when selecting by id or date+marker."New value: +"New marker name. Per-marker."
    • changedInput schema / properties / new_date / description
      Previous value: -"New collection date. Format: YYYY-MM-DD. Optional, omit if not changing. This is the main reason to call this tool, and it works with any selector."New value: +"New collection date, YYYY-MM-DD; the main reason to call this tool."
    • changedInput schema / properties / notes / description
      Previous value: -"New notes. Optional, omit if not changing. Only allowed when selecting by id or date+marker. See NOTES above."New value: +"New notes. Per-marker; see NOTES."
    • changedInput schema / properties / panel_name / description
      Previous value: -"Optional, narrows a date (or date+marker) selector to one panel within that draw (e.g. \"Lipid Panel\"). Ignored when id is given."New value: +"Narrows a date (or date+marker) selector to one panel in that draw, e.g. \"Lipid Panel\". Ignored with id."
    • changedInput schema / properties / panel_name_new / description
      Previous value: -"New panel name. Optional, omit if not changing. Works with any selector."New value: +"New panel name."
    • changedInput schema / properties / report_date / description
      Previous value: -"New report/result date, separate from the collection date. Format: YYYY-MM-DD. Optional, omit if not changing. Works with any selector."New value: +"New report/result date, separate from the collection date, YYYY-MM-DD."
    • changedInput schema / properties / result_comparator / description
      Previous value: -"New comparator for a reporting-limit result (e.g. \"<9\"), or \"none\" to clear it back to an exact value. Optional, omit if not changing. Only allowed when selecting by id or date+marker. See NOTES above."New value: +"New comparator for a reporting-limit result (e.g. \"<9\"), or \"none\" to clear it back to an exact value. Per-marker; see NOTES."
    • changedInput schema / properties / result_unit / description
      Previous value: -"New unit of measurement (e.g. \"mg/dL\"). Optional, omit if not changing. Only allowed when selecting by id or date+marker. See NOTES above."New value: +"New unit, e.g. \"mg/dL\". Per-marker; see NOTES."
    • changedInput schema / properties / result_value / description
      Previous value: -"New numeric result value. Optional, omit if not changing. Only allowed when selecting by id or date+marker. See NOTES above."New value: +"New numeric result value. Per-marker; see NOTES."
  2. Changed4 schema fields changed
    • changedInput schema / properties / notes / description
      Previous value: -"New notes. Optional, omit if not changing. Only allowed when selecting by id or date+marker."New value: +"New notes. Optional, omit if not changing. Only allowed when selecting by id or date+marker. See NOTES above."
    • addedInput schema / properties / result_comparator
      Added value: +{
      +  "description": "New comparator for a reporting-limit result (e.g. \"<9\"), or \"none\" to clear it back to an exact value. Optional, omit if not changing. Only allowed when selecting by id or date+marker. See NOTES above.",
      +  "enum": [
      +    "<",
      +    ">",
      +    "<=",
      +    ">=",
      +    "none"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / result_unit / description
      Previous value: -"New unit of measurement (e.g. \"mg/dL\"). Optional, omit if not changing. Only allowed when selecting by id or date+marker."New value: +"New unit of measurement (e.g. \"mg/dL\"). Optional, omit if not changing. Only allowed when selecting by id or date+marker. See NOTES above."
    • changedInput schema / properties / result_value / description
      Previous value: -"New numeric result value. Optional, omit if not changing. Only allowed when selecting by id or date+marker."New value: +"New numeric result value. Optional, omit if not changing. Only allowed when selecting by id or date+marker. See NOTES above."
  3. Changed1 schema field changed
    • changedInput schema / properties / draw_id / description
      Previous value: -"Draw ID grouping a set of results from one visit. Selects every result in that draw, unambiguous by construction. Alternative to id/date. Ignored when id is given."New value: +"Opaque label of your choosing grouping a set of results from one visit, normalized server-side. Selects every result sharing that label, unambiguous by construction. Alternative to id/date. Ignored when id is given."
  4. Changed6 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"Collection date of the draw to update. Format: YYYY-MM-DD. Selects every result from that draw, or (with marker) one row. Alternative to id."New value: +"Collection date of the draw to update. Format: YYYY-MM-DD. Selects every result from that draw (see AMBIGUITY above), or (with marker) one row. Alternative to id/draw_id."
    • addedInput schema / properties / draw_id
      Added value: +{
      +  "description": "Draw ID grouping a set of results from one visit. Selects every result in that draw, unambiguous by construction. Alternative to id/date. Ignored when id is given.",
      +  "type": "string"
      +}
    • addedInput schema / properties / fasting_status
      Added value: +{
      +  "description": "New fasting status for the whole draw. See FASTING above. Optional, omit if not changing. Works with any selector.",
      +  "enum": [
      +    "fasting",
      +    "non_fasting",
      +    "unknown"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / id / description
      Previous value: -"Lab result ID. Selects a single marker row. Alternative to date."New value: +"Lab result ID. Selects a single marker row. Alternative to date/draw_id."
    • changedInput schema / properties / marker / description
      Previous value: -"Optional with date: marker-name substring, case-insensitive (e.g. \"LDL\"), narrowing the date selector to a single marker row so per-marker fields can be edited without an id. Ignored when id is given."New value: +"Optional with date: marker-name substring, case-insensitive (e.g. \"LDL\"), narrowing the date selector to a single marker row so per-marker fields can be edited without an id. Ignored when id or draw_id is given."
    • addedInput schema / properties / report_date
      Added value: +{
      +  "description": "New report/result date, separate from the collection date. Format: YYYY-MM-DD. Optional, omit if not changing. Works with any selector.",
      +  "type": "string"
      +}
  5. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true, destructiveHint=false, so the safety profile is covered; the description then adds real behavioral context the annotations cannot: ambiguous date selectors are rejected "with nothing changed," note text is regenerated and folded alongside existing free text rather than overwriting it, and 'unknown' fasting exists to undo a mistaken confirmation. Only the return shape is left to the output schema.

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?

Front-loaded one-line purpose followed by labelled sections (SELECTOR, AMBIGUITY, FASTING, NOTES) that each earn their place. It is dense and long, and the SELECTOR prose partly restates the per-parameter schema descriptions, but no section is filler.

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 16-parameter mutation tool the description covers selector rules, field classes, ambiguity recovery and note side effects, and an output schema plus annotations handle return values and safety. The only remaining gap is that zero required parameters are not flagged, so an agent must infer that a selector is nonetheless mandatory.

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

Parameters5/5

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

Schema coverage is 100%, so baseline would be 3, but the description carries meaning the schema does not: it partitions fields into draw-level (new_date, panel_name_new, lab_name, fasting_status, report_date) versus per-marker (result_value, result_unit, result_comparator, marker_name, flag, notes) and states which selectors accept which class. That is the single most error-prone aspect of a 16-parameter tool and it is spelled out.

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?

"Update fields on an existing lab result" is a specific verb+resource, and the use clause ("correcting a result already logged, most often its collection date") separates it from the logging sibling implied by list_lab_results/log_lab_results. An agent knows immediately this is a correction path on an existing row, not a create.

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

Usage Guidelines5/5

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

Explicit when-to-use (correcting an already-logged result), explicit when-not (never infer fasting_status from time of day or a notes mention), and a full fallback path when a selector is ambiguous: "retry with draw_id, marker, or a narrower panel_name." Selector precedence (exactly one of id | date | date+marker | draw_id) removes guesswork.

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.