R/ai_tool_read_file.R

Defines functions read_file

read_file <- function(args) {
  if (!validate_command_args(ai_tool_read_file, args)) {
    stop("Invalid arguments for ReadFile")
  }
  list(filepath = args$filepath, content = paste(readLines(args$filepath), collapse = "\n"))
}

ai_tool_read_file <- list(
  name = "ReadFile",
  parameters = list(
    list(name = "filepath")
  ),
  display_title = "Read File",
  would_like_to = "Read `{filepath}`",
  is_currently = "Reading `{filepath}`",
  has_already = "Read `{filepath}`",
  readonly = TRUE,
  execute = read_file
)

Try the myownrobs package in your browser

Any scripts or data that you put into this service are public.

myownrobs documentation built on Nov. 5, 2025, 5:52 p.m.