Skip to main content
Glama

Get Diagnostic Reports

get_diagnostic_reports
Read-onlyIdempotent

List a patient's FHIR R4 diagnostic reports—lab panels, imaging, and pathology—with an optional since date to narrow long histories.

Instructions

List FHIR R4 DiagnosticReport resources (lab panels, imaging and pathology reports) for one patient. Pass since (YYYY-MM-DD) for patients with a long history. Returns a JSON array with status, category, report code, effective and issued times, coded conclusions and references to the result Observations. The narrative conclusion and attached documents are never returned; use get_lab_results for the values. 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_diagnostic_reports"
  }
}

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.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds substantial context they cannot convey: the audit record with HMAC-hashed patient id and no PHI logging, the ordering of the access check before any FHIR request, the 200-result ceiling, and the exact error strings. The only letdown is that the 'Read only' sentence merely restates readOnlyHint=true.

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 with purpose and return shape, then behavior, then failure modes — a logical order with little fat. Minor redundancy ('Read only') and the dense run of verbatim error strings cost it the top score, but nearly every sentence carries actionable information.

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?

With no output schema, the description compensates by describing the returned JSON array fields (status, category, report code, effective/issued times, conclusions, Observation references) and explicitly what is excluded. Error paths, result cap, access control, and audit behavior are all covered for a two-parameter read tool.

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%, so both patient_id (FHIR logical id, not a name or MRN) and since (YYYY-MM-DD, inclusive start date) are already fully documented. The description restates the since format and its long-history motivation but adds nothing new about either parameter beyond the schema.

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 (list FHIR R4 DiagnosticReport resources), scopes it to one patient, and enumerates the content types (lab panels, imaging, pathology). It also distinguishes itself from get_lab_results for the underlying values, so an agent can tell the two apart without opening schemas.

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?

Gives concrete when-to-use guidance: pass since for patients with a long history, and use get_lab_results instead when the actual result values are wanted. It also warns that narrative conclusions and attached documents are never returned, preventing a wasted call.

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