Skip to main content
Glama

read_file

Read-onlyIdempotent

Reads any source file from a repository without shell access, using repo-relative paths with optional line offsets and limits for paginated code inspection.

Instructions

Read an arbitrary source file from a repository without shelling out.

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": {
      "repo": "<repo>",
      "path": "<path>"
    },
    "name": "read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesRepo-relative file path, e.g. src/ir/pass_manager.py or python/pypto/ir/ops.py
repoYesRepository name from list_repositories(), e.g. "pypto"
offsetNoZero-indexed line to start reading from (for pagination)
max_linesNoMaximum lines to return (1–2000)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered by structured data and the description adds nothing there. The only extra context is the anti-shell framing. Nothing is said about truncation, what happens past max_lines, or errors on missing paths, which is behavior an agent actually needs for a paginated file read.

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?

A single front-loaded sentence with no filler; the core action and the non-shell rationale are both up front. It is however so terse that it leaves gaps rather than earning every sentence's place by covering them.

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

Completeness3/5

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

An output schema exists, so return shape need not be described, and parameters are fully documented in the schema. Still, for a paginated file reader defaulting to 200 lines with a 2000-line cap, the description omits whether results are truncated or how pagination should proceed, which is the main residual gap.

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 description coverage is 100%, with path, repo, offset and max_lines each documented including an example path and the 1–2000 bound, so the schema carries semantics fully. The description adds no further meaning beyond that, making the baseline 3 appropriate.

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?

"Read an arbitrary source file from a repository" gives a specific verb plus resource, and "without shelling out" signals it as the non-shell alternative to a command-execution path. It stops short of naming a sibling tool or stating what kinds of files are out of scope, so differentiation is implied rather than explicit.

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?

The phrase "without shelling out" implies the agent should prefer this over run_command for inspecting source, which is real but indirect guidance. There is no statement of when to avoid it (binary files, huge files) or how it relates to other read tools like read_doc.

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