Skip to main content
Glama

Get Lab Results

get_lab_results
Read-onlyIdempotent

Retrieve a patient's lab results by patient ID and optional start date without needing a LOINC code; returns status, test code, timing, values, interpretations, and panel components.

Instructions

List laboratory Observation resources for one patient without knowing a code; use search_observations when you know the LOINC code. Pass since (YYYY-MM-DD) for patients with a long history. Returns a JSON array with status, code, effective or issued time, the value, coded interpretation (for example high or low) and panel components. Read only. Every call writes one audit record in which the patient id is HMAC-hashed; no PHI is logged. Access is checked first against the server patient policy: a patient outside the caller grant returns "Patient access not authorized" before any FHIR request. More than 200 results returns "Too many results (more than 200); narrow the request". Other failures return "FHIR request failed" with no server detail.

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": {
      "patient_id": "<patient_id>"
    },
    "name": "get_lab_results"
  }
}

Input Schema

NameRequiredDescriptionDefault
sinceNoOptional start date, YYYY-MM-DD. Only records dated on or after this date are returned; use it when a patient has a long history.
patient_idYesFHIR logical id of the Patient, 1 to 64 letters, digits, dots or hyphens, for example a sandbox id returned by the FHIR server. Not a name, MRN or other identifier.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint=false), and the description adds substantial context beyond them: an audit record per call with an HMAC-hashed patient id and no PHI logging, a server patient-policy check that runs before any FHIR request, and the exact error strings returned for unauthorized patients, overflow, and generic failures. That is precisely the kind of operational behavior an agent cannot infer from structured fields.

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?

It is front-loaded with the core purpose and alternative, then layers the return shape, logging, and error behavior in a logical order with no filler. It is longer than typical, but the density is justified by the access-control and error contract; the 'Read only.' sentence is the only piece that merely duplicates an annotation.

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?

There is no output schema, yet the description describes the returned JSON array fields (status, code, effective/issued time, value, interpretation, panel components), the result cap, and the failure modes. For a two-parameter read tool with no nested objects, nothing an agent needs to call it or interpret results is missing.

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 description coverage is 100%: patient_id is already documented as a FHIR logical id (not a name or MRN) and since as an inclusive YYYY-MM-DD start date. The description's 'Pass since (YYYY-MM-DD) for patients with a long history' largely restates the schema, adding only the practical motivation for using it, so the baseline of 3 applies.

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 opens with a specific verb and resource ('List laboratory Observation resources') and adds the defining scope constraint ('for one patient without knowing a code'), then names the sibling that covers the complementary case (search_observations with a LOINC code). An agent can separate this from get_vital_signs or search_observations without opening the schema.

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?

It states when to use this tool (no code known) and names the explicit alternative plus the condition selecting it (when you know the LOINC code). It also gives a usage hint for the optional since parameter ('patients with a long history') and a mitigating instruction when the 200-result cap is hit ('narrow the request').

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