Skip to contents

Registers a list of tool specifications (as returned by e.g. winston::timelog_tool_specs()) on the active session.

Usage

hal_register_tool_specs(specs)

Arguments

specs

A list of tool spec lists.

Value

Invisibly returns the number of tools registered.

Details

Each spec must be a list with at minimum name, description, and handler (a function). Optional: parameters (JSON Schema).

Examples

if (FALSE) { # \dontrun{
specs <- list(
  list(
    name = "row_count",
    description = "Count the rows of a data frame in the global environment",
    handler = function(name) nrow(get(name, envir = globalenv()))
  )
)
hal_register_tool_specs(specs)
} # }