Defines a tool or action that an agent can perform. Used for prompt-based tool discovery.
Public fields
nameString. The unique name of the tool.
descriptionString. A clear description of what the tool does.
parametersList. A description of the expected parameters.
exampleString. An example of how to use the tool.
Examples
if (FALSE) { # \dontrun{
# Define a tool for searching genomic databases
tool <- AgentTool$new(
name = "blast_search",
description = "Perform a BLAST search against the NCBI non-redundant database.",
parameters = list(
query = "The DNA sequence string",
evalue = "The e-value threshold (default 1e-5)"
),
example = "blast_search(query='ATGC...', evalue=0.001)"
)
# Format for injection into a system prompt
message(tool$format())
} # }