By default, acquaint supplies tools from btw::btw_tools()
to allow clients
to peruse package documentation, inspect your global environment, and query
session details. This function allows you register any tools created with
ellmer::tool()
instead.
A call to this function must be placed in your .Rprofile
and the client
(i.e. Claude Desktop or Claude Code) restarted in order for the new tools
to be registered.
acquaint will always register the tools "list_r_sessions" and "select_r_session" in addition to the tools provided here; those tool names are thus reserved for the package.
Arguments
- x
A list of tools created with
ellmer::tool()
. Any list that could be passed tochat$set_tools()
can be passed here.
Value
x
, invisibly. Called for side effects. The function will error if x
is
not a list of ellmer::ToolDef
objects or if any tool name is one of the
reserved names "list_r_sessions" or "select_r_session".
Examples
library(ellmer)
tool_rnorm <- tool(
rnorm,
"Draw numbers from a random normal distribution",
n = type_integer("The number of observations. Must be a positive integer."),
mean = type_number("The mean value of the distribution."),
sd = type_number("The standard deviation of the distribution. Must be a non-negative number.")
)
# supply only one tool, tool_rnorm
mcp_set_tools(list(tool_rnorm))
# supply both tool_rnorm and `btw_tools()`
mcp_set_tools(c(list(tool_rnorm), btw::btw_tools()))