hal_register_tool_specs: Register Tool Specs

View source: R/tool-builder.R

hal_register_tool_specsR Documentation

Register Tool Specs

Description

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.

Details

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

Value

Invisibly returns the number of tools registered.

Examples

## Not run: 
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)

## End(Not run)

hal documentation built on Oct. 6, 2026, 5:07 p.m.