Skip to main content
Glama

files_read

Read indexed files by ID or path in full, by heading, or by line range; batch up to 200 IDs to retrieve content for AI context.

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

NameRequiredDescriptionDefault
idNoSingle file by ID.
idsNoBatch mode: multiple file IDs (max 200 per call); returns an array plus aggregate token cost.
pathNoSingle file by absolute on-disk path (must match exactly what Kontexta indexed).
linesNoPartial read: 1-indexed inclusive line range. Requires `id`; mutually exclusive with `section`.
sectionNoPartial read: return only this heading's body (case-insensitive exact-string after trim). Requires `id`; mutually exclusive with `lines`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv6.1.2

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full disclosure burden and does so: 'Read-only; no side effects, auth, or rate limits.' It also documents batch failure semantics ('per-ID failures isolated, batch never partial-throws'), which is non-obvious behavior an agent needs before choosing a mode.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core action, then packs modes, constraints, behavioral guarantees, and response shape into dense, well-ordered sentences with no filler. It is long but nearly every clause carries an operational constraint, so little could be cut without losing routing value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema provided, the description compensates by describing all three response shapes (single file object, partial-content object, and the {files, total_est_tokens, error_count, errors} batch envelope). For a 5-param, nested-object tool with no annotations, nothing needed to call it correctly appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds constraints the JSON schema cannot express: exactly one of id/path/ids is required, section/lines are mutually exclusive, and both are valid only with id (not ids or path). It also clarifies the path must be the exact indexed absolute path, which sharpens a fuzzy parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Read one or more files, in full or in part') and enumerates every mode with the exact parameter combination that triggers it. It also distinguishes itself from a sibling by naming files_describe as the inspect-without-cost alternative, so an agent can route correctly without opening another schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Each mode is tied to a concrete condition (single-by-id, single-by-path, batch up to 200, partial-by-heading, partial-by-line-range), and it explicitly routes inspection-only work to files_describe. It stops short of addressing other close siblings like files_read_outline or files_regex_search, so the guidance is clear but not fully exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.