Skip to main content
Glama

Read file

read_file
Read-only

Read a UTF-8 text file from a workspace and return its content with line numbers. Use offset and limit to inspect specific line ranges before editing.

Instructions

Read a UTF-8 text file from the workspace and return its content with 1-based line numbers in the form 'N: '. Use this before editing a file, or to inspect specific line ranges with offset/limit. Do not use it for binary files (they are rejected), to search file contents (use grep), or to discover files (use list_files).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesWorkspace-relative path of the file to read. Absolute paths inside the workspace are also accepted.
limitNoMaximum number of lines to return. Defaults to 2000 and is capped at 2000.
offsetNo1-based line number to start reading from. Defaults to 1.
workspaceNoWorkspace name (see workspace_list). Defaults to the primary workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, covering the safety profile. The description adds valuable behavioral context beyond that: UTF-8-only support, rejection of binary files, and the exact line-numbered output shape. It stops short of describing error behavior, but the disclosed traits are sufficient for a read operation.

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 sentences with no wasted words. The purpose and output format are front-loaded, followed by compact usage guidance and exclusions. Every clause earns its place.

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?

For a read-only file tool, the description covers what it reads, how output is formatted, when to use it, and which tools should be used instead. With no output schema present, the explicit line-number format is especially valuable and makes the tool effectively self-contained.

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%, and every parameter already has a clear description. The description adds only light semantic color by mentioning offset/limit for line ranges, but it does not meaningfully extend what the schema already provides. This matches the baseline for high schema coverage.

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 names a specific verb ('Read'), a specific resource ('UTF-8 text file from the workspace'), and the output format ('1-based line numbers'). It also distinguishes itself from siblings by explicitly excluding search (grep) and discovery (list_files), so an agent can select it correctly without opening the schema.

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?

The description gives concrete when-to-use guidance: before editing a file and for inspecting line ranges via offset/limit. It also gives explicit when-not-to-use guidance for binary files, content search (grep), and file discovery (list_files), naming the exact alternatives.

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