Skip to main content
Glama

read_file_content

Read file content with line-range slicing and automatic secret redaction. Inspect, debug, or verify exact implementation logic safely without network calls.

Instructions

Reads raw source code from a single file, with optional line-range slicing and automatic security redaction for secrets and sensitive keys.

Behavior: Read-only operation. Zero file modifications and zero network calls. Automatically masks detected credentials. Returns formatted Markdown code block with line indicators.

When to use: Use this when you must inspect, debug, or verify exact line-by-line implementation logic of a specific file identified through previous outline or mapping steps.

When NOT to use: Do NOT use this for blind exploration of unfamiliar files (use read_file_outline or get_codebase_map first to conserve token budget).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endLineNo1-indexed ending line number, inclusive (optional, default: end of file).
rootDirNoBase directory used to resolve relative filePath. Defaults to current working directory (".").
filePathYesRelative or absolute path to the file to inspect.
startLineNo1-indexed starting line number (optional, default: 1). Useful for viewing specific functions or ranges in large files.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.2.0

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden—and it does so thoroughly. It states read-only operation, zero file modifications, zero network calls, automatic masking of credentials, and the Markdown code-block output format with line indicators. This is unusually complete behavioral disclosure.

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 organized into short labeled sections: Behavior, When to use, and When NOT to use, plus a one-sentence opener. Every sentence earns its place, and the most important facts—single file, raw source, redaction—are front-loaded.

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 annotations and no output schema, the description covers the safety profile (read-only, no network), the return format (Markdown code block with line indicators), and the appropriate usage boundaries. The schema fully covers all four parameters, so nothing essential is missing for correct invocation.

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%, so the baseline is 3. The description mentions 'optional line-range slicing,' which conceptually maps to startLine/endLine, but it does not add meaning beyond the schema's own parameter descriptions. The schema already documents defaults and 1-indexed behavior.

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 opens with a specific verb-resource pair: 'Reads raw source code from a single file,' and further clarifies it supports line-range slicing and redaction. It is clearly distinguished from sibling outline/map tools by emphasizing exact line-by-line content rather than structural overviews.

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?

An explicit 'When to use' block says to use it for inspecting, debugging, or verifying line-by-line implementation of a specific file. An explicit 'When NOT to use' block warns against blind exploration and names read_file_outline and get_codebase_map as token-saving alternatives, giving the agent concrete decision rules.

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