Read a file under the app's userData dir
read_user_data_fileRead a file from Electron's userData directory safely, with path-traversal protection. Returns text content and resolved absolute path.
Instructions
Safely read a file relative to the session's app.getPath('userData') (e.g. config.json, api-logs/api.log). Path-traversal protected: paths are resolved against userData and rejected if they escape it. Returns the text content (up to the size cap) along with the resolved absolute path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Session id. | |
| relPath | Yes | Path relative to `userData`, e.g. `config.json` or `api-logs/2026-05-08.log`. | |
| maxBytes | No | Read cap in bytes (default 1 MB). |