Skip to main content
Glama

localnest_read_file

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

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
      )
    );

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