FileReadTools

LLM-ready ToolCallbacks and convenience methods for file operations. Use at your own risk: This makes changes to your host machine!!

Inheritors

Properties

Link copied to clipboard

Provide sanitizers that run on file content before returning it. They must be sure not to change any content that may need to be replaced as this will break editing if editing is done in the same session.

Link copied to clipboard
abstract val root: String

Root on host machine

Link copied to clipboard
open override val toolCallbacks: List<<Error class: unknown class>>

Tool callbacks referenced or exposed.

Functions

Link copied to clipboard

Expose the ToolGroup as an interface

Link copied to clipboard
open fun exists(): Boolean

Does this file exist?

Link copied to clipboard
open fun fileCount(): Int

Count the total number of files in the repository (excluding .git directory). Uses FileVisitor for cross-platform compatibility (Windows and Linux).

Link copied to clipboard
open fun findFiles(glob: String): List<String>

open fun findFiles(glob: String, findHighest: Boolean): List<String>

Find files using glob patterns.

Link copied to clipboard
abstract fun flushReads()
Link copied to clipboard
open override fun getPathsAccessed(): List<String>
Link copied to clipboard
open fun getPathsRead(): List<String>
Link copied to clipboard
abstract fun getReads(): List<FileReads>
Link copied to clipboard
open fun listFiles(path: String): List<String>
Link copied to clipboard
open fun readFile(path: String): String
Link copied to clipboard
abstract fun recordRead(path: String)
Link copied to clipboard
Link copied to clipboard
open fun resolvePath(path: String): Path
Link copied to clipboard
open fun safeReadFile(path: String): String?

Use for safe reading of files. Returns null if the file doesn't exist or is not readable.