Skip to main content
Glama

Read

redctx_read
Read-onlyIdempotent

Read a single file or an inclusive line range, returning redacted text with preserved line numbers so you can cite exact lines.

Instructions

Return the redacted text of one file, or an inclusive 1-based line range of it, after a header line --- @p_<id> <redacted path> lines S-E ---. Use it to read a single file or cite exact lines; use redctx_bundle to load several whole files in one call, and redctx_search or redctx_retrieve to locate the lines first. Redaction preserves line numbering, and text beyond max_chars is cut with a [TRUNCATED] marker that never splits a placeholder. Binary, excluded or protected files and files over the server's per-file byte limit (5 MB by default) are refused with an error; DOCX, PPTX, PDF, XLSX and XLS files are readable as extracted Markdown only when the server runs with --documents.

Input Schema

NameRequiredDescriptionDefault
pathYesFile to read: an `@p_<id>` reference from earlier output or a root-relative path.
end_lineNoLast line to return, 1-based and inclusive; values past the end of the file are clamped. Default: the last line.
max_charsNoMaximum characters of file text returned after the line range is applied; longer text is cut and ends with `[TRUNCATED]`. Default 120000.
start_lineNoFirst line to return, 1-based and inclusive. Default 1. Must not exceed `end_line`, or the file's last line when `end_line` is omitted.
line_numbersNoPrefix each line with its source line number and a tab. Default false.

Output Schema

NameRequiredDescriptionDefault
textYesThe tool output, identical to the text content block and already redacted: sensitive values appear as deterministic `[CATEGORY_<hex>]` placeholders (forms declared as aliases of one entity share its hex and add a form suffix, `[CATEGORY_<hex>.<form>]`) and files as `@p_<id>` references. When the result has `isError: true`, this is a fixed error message instead, such as a limit error or the notice that context access is blocked until the operator repairs the local redaction config.
receiptYesRedaction statistics for this call only; never contains original values.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv0.10.0
    • addedInput schema / properties / end_line / description
      Added value: +"Last line to return, 1-based and inclusive; values past the end of the file are clamped. Default: the last line."
    • addedInput schema / properties / line_numbers / description
      Added value: +"Prefix each line with its source line number and a tab. Default false."
    • addedInput schema / properties / max_chars / description
      Added value: +"Maximum characters of file text returned after the line range is applied; longer text is cut and ends with `[TRUNCATED]`. Default 120000."
    • changedInput schema / properties / path / description
      Previous value: -"Path or @p_<id> reference."New value: +"File to read: an `@p_<id>` reference from earlier output or a root-relative path."
    • addedInput schema / properties / start_line / description
      Added value: +"First line to return, 1-based and inclusive. Default 1. Must not exceed `end_line`, or the file's last line when `end_line` is omitted."
    • addedOutput schema / description
      Added value: +"Structured copy of every tool result: the output text plus a receipt of what redaction did."
    • addedOutput schema / properties / receipt / description
      Added value: +"Redaction statistics for this call only; never contains original values."
    • addedOutput schema / properties / receipt / properties / counts_by_category / description
      Added value: +"Placeholders substituted while producing this result (content and paths), keyed by category such as `PERSON`, `EMAIL` or `SECRET`; categories with none are omitted."
    • addedOutput schema / properties / receipt / properties / detector_profile / description
      Added value: +"Active built-in detector profile: `default`, or `extended`, which adds more identifier types and prompt-injection markers."
    • addedOutput schema / properties / receipt / properties / detectors
      Added value: +{
      +  "description": "Present only when the server runs additional local detectors: one entry per detector, in load order.",
      +  "items": {
      +    "properties": {
      +      "name": {
      +        "description": "Detector name.",
      +        "type": "string"
      +      },
      +      "nominated": {
      +        "description": "Distinct values this detector nominated during the call; every occurrence of each is redacted.",
      +        "type": "integer"
      +      },
      +      "positional": {
      +        "description": "Nominated spans redacted only at their own position, because they were too long or exceeded the per-text value budget.",
      +        "type": "integer"
      +      },
      +      "version": {
      +        "description": "Detector version string.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "version",
      +      "nominated",
      +      "positional"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / text / description
      Added value: +"The tool output, identical to the text content block and already redacted: sensitive values appear as deterministic `[CATEGORY_<hex>]` placeholders (forms declared as aliases of one entity share its hex and add a form suffix, `[CATEGORY_<hex>.<form>]`) and files as `@p_<id>` references. When the result has `isError: true`, this is a fixed error message instead, such as a limit error or the notice that context access is blocked until the operator repairs the local redaction config."
  2. First observedv0.4.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover only safety traits (readOnly, idempotent, non-destructive), so the description must carry operational behavior—and it does richly: redaction preserves line numbering, text past max_chars is cut with [TRUNCATED] that never splits a placeholder, binary/excluded/protected and >5MB files are refused with an error, and DOCX/PPTX/PDF/XLSX/XLS require the --documents flag. This is exactly the beyond-annotation context an agent needs.

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-loaded with the core action and return format in the first sentence, then routing guidance, then constraints. Dense but every clause earns its place; the long final sentence about formats and byte limits is somewhat packed but relevant.

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?

Given annotations for safety, a full output schema, and 100% schema parameter coverage, the description supplies the remaining behavioral envelope: header format, truncation mechanics, error conditions, guarded file types, and format prerequisites. An agent has everything needed to call it correctly.

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

Parameters3/5

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

Schema coverage is 100%, so all five parameters are already documented in the schema (clamping, 1-based inclusive semantics, defaults). The description adds cross-cutting behavior (line-number preservation, truncation interaction with max_chars) but no per-parameter semantics beyond the schema; baseline 3 applies.

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 (return the redacted text) and precise resource scope (one file, or an inclusive 1-based line range), including the exact header format emitted. It explicitly names siblings it is not (redctx_bundle for whole files, redctx_search/redctx_retrieve to locate lines), so it is distinguishable without opening schemas.

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

Usage Guidelines5/5

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

Explicitly says when to use it (read a single file, cite exact lines) and gives the alternatives with their selecting conditions: redctx_bundle for several whole files, redctx_search/redctx_retrieve to find lines first. Nothing is left to inference.

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