Get Labs
Overview
get_labs retrieves laboratory results for a specific patient from FHIR Observation resources. An LLM/agent
should call this tool when the user asks about lab results, blood tests, panels, or specific laboratory
measurements — CBC, metabolic panel, cholesterol, glucose, hemoglobin A1c, or similar. For neutrophils/lymphocytes,
use 'Complete Blood Count' (includes all cell differentials); use full test names rather than abbreviations
(e.g. 'CRP' not 'c-reactive protein').
Required Parameters
None — all parameters are optional (though person_id is effectively required unless derivable from the token).
Optional Parameters
person_id (string)
- Default:
None - The FHIR identifier (patient ID) of the person whose lab results are to be retrieved. Extracted from the access token if not provided.
labs (list of exact lab test names from the FHIR_LABS literal)
- Default:
None(all available lab results) - Invalid names are ignored (logged, or reported via
ctx.infowhendebug=true); if every provided name is invalid, all labs are returned instead.
start_date / end_date (date, YYYY-MM-DD)
- Default:
None - Inclusive date bounds. No bound applied if omitted.
count (integer)
- Default: the environment's
observations_default_count - Number of raw FHIR records to fetch before filtering. Minimum of 300 automatically enforced; increase to 1000–5000 for comprehensive historical searches.
output_formats (list of table | timeline | statistics | csv | markdown)
- Default:
["table", "statistics"] tablefor detailed records,statisticsfor aggregated insights,timelinefor chronological view,csvfor export,markdownfor documentation. Multiple formats can be combined.
ignore_cache (boolean)
- Default:
false - If true, bypasses any cached data and fetches fresh records from the FHIR server.
debug (boolean)
- Default:
false - Enable to include additional diagnostic information in the response.
Returns
FhirRecordRetrievalOutput — a result field containing the retrieved lab data as a string, formatted per output_formats.
Updated about 1 month ago
