# Read VFS path

URL: https://docs.clinia.com/sdks/reference/vfs/read-vfs

Returns the content of a VFS file at the given path. Three output formats are supported: `narrative` (full Markdown, default), `compact` (condensed Markdown), and `structured` (machine-readable JSON). Use `token_budget` to cap approximate output length in tokens in `narrative` or `compact`; a `structured` read refuses it with a 400, since cut JSON does not parse.

## Usage [#usage]

```javascript tab="JavaScript" tab-group="sdk-language"
import { ContextEngineClient } from "@clinia/context-engine-js";

// Initialize the client
const client = new ContextEngineClient({
  baseUrl: process.env.CLINIA_WORKSPACE,
  auth: {
    clientId: process.env.CLINIA_CLIENT_ID,
    clientSecret: process.env.CLINIA_CLIENT_SECRET,
  },
});

// Call the API
const { data, error } = await client.vfs.readVfs("<patient-id>");

// Print the response
console.log(data ?? error);
```

```python tab="Python" tab-group="sdk-language"
import os
from clinia_context_engine import ClientCredentials, ContextEngineClient

# Initialize the client
client = ContextEngineClient(
    base_url=os.environ["CLINIA_WORKSPACE"],
    auth=ClientCredentials(
        client_id=os.environ["CLINIA_CLIENT_ID"],
        client_secret=os.environ["CLINIA_CLIENT_SECRET"],
    ),
)

# Call the API
result = client.vfs.read_vfs("<patient-id>")

# Print the response
print(result)
```

The environment variables are set in Install and authenticate, for [JavaScript](https://docs.clinia.com/sdks/javascript#install-and-authenticate) or [Python](https://docs.clinia.com/sdks/python#install-and-authenticate).

## API reference [#api-reference]

[`GET /v1/patients/{patientId}/read`](https://docs.clinia.com/api/rest/get-patients-patientId-read) documents the parameters, the request body and the responses.
