files.read
Retrieve file contents from the Kontexta vault by ID or path, read full files, batch up to 200, or extract specific sections or line ranges for token-efficient access.
Instructions
Read one or more files, in full or in part. Modes: single-by-id (id), single-by-path (path, absolute on-disk path — must be exactly as indexed), batch-by-id (ids, up to 200), partial-by-heading (id+section), partial-by-line-range (id+lines). Exactly one of id/path/ids is required. section and lines are mutually exclusive and only valid with id (not ids or path). Read-only; no side effects, auth, or rate limits. Response shape: a single file object (with content, tags, est_tokens) for id/path; a partial-content object for section/lines; {files, total_est_tokens, error_count, errors} for ids (per-ID failures isolated, batch never partial-throws). Prefer files.describe to inspect without paying body tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Single file by ID. | |
| ids | No | Batch mode: multiple file IDs (max 200 per call); returns an array plus aggregate token cost. | |
| path | No | Single file by absolute on-disk path (must match exactly what Kontexta indexed). | |
| lines | No | Partial read: 1-indexed inclusive line range. Requires `id`; mutually exclusive with `section`. | |
| section | No | Partial read: return only this heading's body (case-insensitive exact-string after trim). Requires `id`; mutually exclusive with `lines`. |