Skip to main content
Glama

Read File

localnest_read_file
Read-onlyIdempotent

Read specific lines from a local file with line numbers to inspect code segments or data sections directly from your machine.

Instructions

Read a bounded chunk of a file with line numbers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
start_lineNo
end_lineNo
response_formatNojson

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
metaNo

Implementation Reference

  • The handler for the 'localnest_read_file' tool is registered using `registerJsonTool` in `src/mcp/tools/retrieval.js`. It takes a file path, start line, and end line, then calls `workspace.readFileChunk` to retrieve the content, which is then formatted by `normalizeReadFileChunkResult`.
    registerJsonTool(
      'localnest_read_file',
      {
        title: 'Read File',
        description: 'Read a bounded chunk of a file with line numbers.',
        inputSchema: {
          path: z.string(),
          start_line: z.number().int().min(1).default(1),
          end_line: z.number().int().min(1).default(defaultMaxReadLines)
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false
        }
      },
      async ({ path, start_line, end_line }) => normalizeReadFileChunkResult(
        await workspace.readFileChunk(path, start_line, end_line, 800),
        path,
        start_line,
        end_line
      )
    );
Behavior3/5

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

Annotations already establish the operation is read-only, idempotent, and non-destructive. The description adds valuable behavioral context about the 'bounded' nature of the read and the inclusion of 'line numbers' in the output. However, it fails to mention error behaviors (e.g., file not found) or the significance of the response_format parameter.

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?

Extremely concise at 9 words with zero filler. The sentence is front-loaded with the action verb 'Read' and every word ('bounded', 'chunk', 'line numbers') conveys essential functional characteristics.

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?

Given the presence of an output schema, the description appropriately omits return value details. However, with 4 parameters and 0% schema coverage, the description is incomplete—it should document the path parameter and clarify the line range defaults to compensate for the missing schema descriptions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description carries the full burden of explaining the 4 parameters (path, start_line, end_line, response_format). It only implicitly hints at start_line/end_line via 'bounded chunk' but provides no explanation for 'path' or 'response_format', leaving critical parameters undocumented.

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?

The description clearly states the core action ('Read') and resource ('File'), with specific qualifiers ('bounded chunk', 'line numbers') that distinguish it from a full file read. However, it does not explicitly differentiate from sibling search tools like localnest_search_files or localnest_search_code.

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 guidance provided on when to use this tool versus alternatives (e.g., when to read directly vs. searching). The description omits critical defaults (start_line defaults to 1, end_line to 400) that would help an agent decide if explicit parameters are needed.

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/wmt-mobile/localnest'

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