The Context Engine Studio is now open source.  View on GitHub →
Tools

read_patient

Reads a path of a patient's virtual file tree in a chosen format, optionally capped to a token budget.

Reads one path of a patient's virtual file tree, in the format and length you choose.

Input

ArgumentTypeRequiredDescription
patient_idstringYesThe patient's patientId. See Shared arguments.
pathstringYesA path relative to the patient, such as /labs/latest. See Paths.
formatstringNonarrative (default), structured or compact. See Formats.
token_budgetnumberNoApproximate cap on the output, in tokens of 4 characters. Omit for no cap. Not allowed with structured.
session_idstringNoA session to record the call on. See Record calls on a session.

Formats

FormatOutputTypical tokens
narrativeProse Markdown with clinical context300–800
structuredJSON with every field200–500
compactKey facts only50–150

VFS Paths details what each format holds for each kind of path.

Output

The content of the path, as text, in the requested format.

Input
{ "patient_id": "abc", "path": "/labs/latest", "format": "compact" }
Output
- 2023-08-15 eGFR: 52 mL/min (>60) [low]
- 2023-09-07 Hemoglobin A1c: 7.1 % (4.0-5.6) [high]
...

When the content is longer than token_budget × 4 characters, it is cut at that length and ends with …[truncated to token budget].

A token_budget with format: "structured" fails the call with isError: true, since cut JSON would not parse. Omit the budget, or read in narrative or compact.

For a path that does not exist, the result has isError: true and its text is path not found: {path}. See Errors.

On this page