Skip to main content
Glama

ctx_read

Read-only

Read specific lines from a file with line numbers by giving a start and end range. Requests exceeding the token budget return the file outline instead, keeping context small.

Instructions

Read lines of a file with line numbers: give start/end. Asking for a whole file that exceeds budget_tokens returns its outline instead. Paths are relative to the project root; nothing outside it is readable.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "ctx_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoLast line (inclusive).
pathYesFile path relative to the project root.
forceNoReturn the lines even if they were already returned unchanged in this session.
startNoFirst line (1-based).
budget_tokensNoHard cap on the tokens returned (estimate; default 3000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the read-only, non-open-world profile, and the description adds real behavior beyond them: output is line-numbered, oversized reads silently substitute an outline instead of content, and reads are path-sandboxed to the project root. The only missing piece is that already-returned lines may be withheld unless force is set, which it leaves to the schema.

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?

Three short sentences, front-loaded with the core action, then the fallback behavior, then the path constraint. No wasted wording, though the opening clause is slightly clipped rather than fully readable.

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

Completeness4/5

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

For a five-parameter read tool with no output schema, the description covers the return shape (line numbers), the budget-driven fallback, and the sandbox boundary. The remaining gap, the session-level deduplication and force override, is adequately handled by the schema, so nothing critical is missing.

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, including the 1-based start, inclusive end, force, and budget_tokens default, are already documented. The description adds one useful semantic link (budget_tokens determines whether an outline is returned) but says nothing extra about force or the start/end pairing, so it lands at the high-coverage baseline.

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

Purpose4/5

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

States a specific verb and resource (read lines of a file, with line numbers) and scopes it with start/end. It implicitly contrasts itself with the outline behavior when a whole file is too large, so an agent can tell it apart from ctx_outline, though no sibling is named directly.

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

Usage Guidelines3/5

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

Usage is implied by 'give start/end' and by the note that an oversized whole-file request degrades to an outline, which hints at when to prefer ctx_outline. There is no explicit when-to-use / when-not-to-use statement or reference to ctx_search or ctx_expand for other retrieval patterns.

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