ReadFileTool

Provides functionality to read file contents with configurable start and end line parameters, returning structured file metadata and content.

Parameters

Path

the filesystem path type used by the provider

Constructors

Link copied to clipboard

Types

Link copied to clipboard
data class Args(val path: String, val startLine: Int = 0, val endLine: Int = -1) : ToolArgs

Specifies which file to read and what portion of its content to extract.

Link copied to clipboard
object Companion
Link copied to clipboard

Contains the successfully read file with its metadata and extracted content.

Properties

Link copied to clipboard

Serializer responsible for encoding and decoding the arguments required for the tool execution. This abstract property is used to define the specific KSerializer corresponding to the type of arguments expected by the tool.

Link copied to clipboard
open override val descriptor: ToolDescriptor

Provides a descriptor detailing the tool's metadata, including its name, description, and parameter requirements. This property defines the structure and characteristics of the tool, offering an overview of its functionality and how it should be used.

Link copied to clipboard

Represents the name property of the tool, derived from the tool's descriptor. This property provides an immutable reference to the tool's unique name, which is used for identification within tool registries.

Functions

Link copied to clipboard

Decodes the provided raw JSON arguments into an instance of the specified arguments type.

Link copied to clipboard

Encodes the given arguments into a JSON representation.

Link copied to clipboard

Encodes the provided arguments into a JSON string representation using the configured serializer.

Link copied to clipboard

Encodes the given result of type TResult to its string representation for the LLM.s

Link copied to clipboard

Encodes the provided result object into a JSON string representation without type safety checks.