execute

open suspend override fun execute(args: ReadFileTool.Args): ReadFileTool.Result(source)

Reads file content from the filesystem with optional line range filtering.

Performs validation before reading:

  • Verifies the path exists in the filesystem

  • Confirms the path points to a file

  • Confirms the file is a text file

If the requested endLine exceeds the file's line count, it will be clamped to the available lines and a warning will be included in the result.

Return

Result containing the file with its content, metadata, and optional warning

Parameters

args

arguments specifying the file path and optional line range

Throws

if the file doesn't exist, is a directory, or is not a text file, or if line range parameters are invalid