Skip to main content
Glama

read_file

Retrieves a file's exact text content for direct use in edits or review. Supports line range selection for large files and never returns credential files.

Instructions

Read a file as text. Returns exact file content (no line numbers by default) so it can be copied verbatim into edit_file anchors. For large files pass start_line/end_line, or use search_code first to find the region worth reading. Credential files (.env, keys, cloud config) are never returned.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the workspace root.
end_lineNo1-based last line to return.
workspaceNoWorkspace alias. Defaults to the active workspace.
start_lineNo1-based first line to return.
line_numbersNoPrefix each line with its number. Navigation aid only — do NOT copy numbered text into edit_file. Default false.
Behavior5/5

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

With no annotations, the description fully discloses key behaviors: returns exact content without line numbers by default, and never returns credential files. This adds meaningful safety and usage context beyond what a plain 'read file' description would provide.

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?

The description is a compact three-sentence structure that front-loads the primary purpose, then adds guidance and caveats. Every sentence provides distinct, necessary value with no redundant or filler content.

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?

Despite having no output schema, the description clearly states the return type ('text' and 'exact file content'), includes default behavior (no line numbers), and covers file size handling and security exclusions. It is sufficiently complete for an agent to use the tool correctly.

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?

The schema already covers all parameters with descriptions (100% coverage), so baseline is 3. The description adds value by linking start_line/end_line to large-file scenarios and warning against copying line_numbered output into edit_file, which enriches the schema's bare definitions.

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?

The description begins with 'Read a file as text', a specific verb and resource that clearly states the tool's function. It further distinguishes from siblings by mentioning exact content for edit_file anchors and search_code for locating regions, clarifying its unique role.

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?

It explicitly explains when to use this tool (for copying verbatim into edit_file) and provides guidance for large files (use start_line/end_line or search_code first). It also gives a clear exclusion (credential files are never returned), guiding appropriate use cases.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zcrossoverz/repo-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server