Skip to main content
Glama

viewFile

Read file contents with line numbers and slice by line range or byte limits. Specify target file and optional start/end lines to view specific sections.

Instructions

Read contents of a file with line numbering and bounded slicing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endLineNoEnding line (1-indexed, inclusive).
maxBytesNoMax bytes allowed in output.
maxLinesNoMax lines to view at once. Default 800.
startLineNoStarting line (1-indexed, inclusive).
targetFileYesAbsolute or workspace-relative path.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose two real behavioral traits beyond the schema: output is line-numbered and slicing is bounded. However, it says nothing about truncation when bounds are exceeded, error behavior for missing/binary files, or the default line cap (that detail lives only 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.

Conciseness4/5

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

A single front-loaded sentence with zero filler; the core action comes first and the qualifiers follow. It is efficient, though arguably it errs on the terse side for a 5-parameter tool.

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?

For a no-annotation, no-output-schema read tool with five parameters, the description is minimally adequate. It omits the interaction between maxBytes/maxLines, what happens on truncation, and any error semantics, which an agent would need to call it confidently at the edges.

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 parameters (startLine, endLine, maxLines, maxBytes, targetFile) are already fully documented and the baseline is 3. The description's 'line numbering' and 'bounded slicing' phrasing only loosely connects to those params and adds no new syntax or constraint detail.

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 contents of a file' states a specific verb and resource, and the modifiers 'line numbering' and 'bounded slicing' narrow the behavior meaningfully. It doesn't name the siblings writeToFile/replaceFileContent, but the read-vs-write distinction is self-evident from the verb.

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

Usage Guidelines2/5

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

No when-to-use guidance, no exclusions, and no mention of the sibling tools. An agent gets no help deciding between an unbounded read and a sliced read, or when to prefer this over other file operations.

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

Deploy Server

Other Tools