Skip to main content
Glama

read_file

Read-onlyIdempotent

Fetch an indexed file or specific line range by repository-relative path to view surrounding context after search_knowledge_base, subject to read permissions.

Instructions

Read an indexed file (or a line range of it) by repository-relative path.

Use after search_knowledge_base to see surrounding context. Only files in the index that you have permission to read are available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
end_lineNo
start_lineNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is covered. The description adds non-obvious behavioral context: reads are restricted to files present in the index and to those the caller may read, which is an authorization/availability constraint not expressible in 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.

Conciseness5/5

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

Two short sentences with no filler; the core action and its scope are front-loaded, and the usage hint follows. Every clause contributes new information.

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?

With an output schema present, return values need no explanation, and the description covers purpose, sequencing, and access constraints. It still leaves edge-case behavior (path not in index, permission denied, out-of-range lines) unspecified.

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 0%, so the description carries the burden: it clarifies that 'path' is repository-relative and that start_line/end_line select a range. However, it never specifies whether the range is inclusive, how end_line interacts with the default start_line=1, or what happens if the range exceeds the file.

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 and resource (read an indexed file) plus the scope options (whole file or line range) and the path convention (repository-relative). This clearly separates it from search_knowledge_base and ask_knowledge_base, which retrieve knowledge rather than file content.

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?

Explicitly routes the agent: 'Use after search_knowledge_base to see surrounding context,' naming the alternative and the sequencing condition. It adds a real availability constraint (only indexed and permission-granted files), though it gives no explicit when-not guidance or fallback behavior when a path is unavailable.

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