# read_patient

URL: https://docs.clinia.com/api/mcp/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](https://docs.clinia.com/docs/context-assembly/virtual-file-system), in the format and length you choose.

## Input [#input]

| Argument       | Type   | Required | Description                                                                                                  |
| -------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `patient_id`   | string | Yes      | The patient's `patientId`. See [Shared arguments](https://docs.clinia.com/api/mcp/server#shared-arguments).                         |
| `path`         | string | Yes      | A path relative to the patient, such as `/labs/latest`. See [Paths](https://docs.clinia.com/api/mcp/server#paths).                  |
| `format`       | string | No       | `narrative` (default), `structured` or `compact`. See [Formats](#formats).                                   |
| `token_budget` | number | No       | Approximate cap on the output, in tokens of 4 characters. Omit for no cap. Not allowed with `structured`.    |
| `session_id`   | string | No       | A session to record the call on. See [Record calls on a session](https://docs.clinia.com/api/mcp/server#record-calls-on-a-session). |

### Formats [#formats]

| Format       | Output                               | Typical tokens |
| ------------ | ------------------------------------ | -------------- |
| `narrative`  | Prose Markdown with clinical context | 300–800        |
| `structured` | JSON with every field                | 200–500        |
| `compact`    | Key facts only                       | 50–150         |

[VFS Paths](https://docs.clinia.com/api/vfs-paths#read-format-and-token-budget) details what each format holds for each kind of path.

## Output [#output]

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

```json title="Input"
{ "patient_id": "abc", "path": "/labs/latest", "format": "compact" }
```

```txt title="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](https://docs.clinia.com/api/mcp/server#errors).
