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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| start_line | No | ||
| end_line | No | ||
| response_format | No | json |
Implementation Reference
- src/mcp/tools/retrieval.js:428-451 (handler)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 ) );