Creates ToolDef object with name, description, and argument specifications for MCP protocol integration. Simplified version for initial integration.
Arguments
- fun
The function to be invoked when the tool is called
- description
A detailed description of what the function does
- arguments
A named list that defines the arguments accepted by the function
- name
The name of the function. This can be omitted if fun is an existing function
- convert
Should JSON inputs be automatically convert to their R data type equivalents (default: TRUE)
- annotations
Additional properties that describe the tool and its behavior
Examples
# Define a simple tool
my_tool <- tool(
function(x) x + 1,
description = "Add 1 to a number",
arguments = list(x = "number")
)
