rllm.tools module exposes the data types (Tool, ToolCall,
ToolOutput) the rLLM parser uses when reading tool calls out of model
responses, plus a small registry. The higher-level MultiTool /
ToolEnvironment wrappers that the old Workflow path used have been
removed.
For a modern tool-using agent, the recommended pattern is to declare
tools as plain Python callables and pass an OpenAI-spec
tools list
directly to the chat-completions API — see
cookbooks/finqa/finqa_tools.py
for a worked example with four tools, native OpenAI function calling,
and a process-wide SQLite store. Use the data types below if you need
to parse tool calls out of a raw text response (e.g. for non-native
tool-call formats); see Parsers.Tool
Base class for all tools.Constructor
str | None
Name of the tool. Required if
function is not provided.str | None
Description of the tool’s purpose. Required if
function is not provided.Callable | None
Function to convert to tool format. If provided, name and description are auto-extracted from docstring.
Properties
dict
Tool schema in OpenAI function calling format.
Methods
forward
Synchronous implementation of tool functionality.ToolOutput
Tool execution result.
async_forward
Asynchronous implementation of tool functionality.call
Make the tool callable.bool | None
Whether to use async implementation. Auto-detects if None.
ToolOutput
Dataclass for tool execution results.Fields
str
Name of the tool that produced this output.
str | list | dict | None
The tool’s output data.
str | None
Error message if execution failed.
dict | None
Additional metadata about the execution.
Methods
to_string
Convert output to string representation.ToolCall
Dataclass representing a tool call.Fields
str
Name of the tool to call.
dict[str, Any]
Arguments to pass to the tool.
ToolRegistry
Singleton registry for managing tools.Methods
register
Register a tool class.str
Name to register the tool under.
type[Tool]
Tool class to register.
register_all
Register multiple tools at once.get
Get a tool class by name.type[Tool] | None
Tool class if found, None otherwise.
instantiate
Instantiate a tool by name.str
Name of the tool to instantiate.
Any
Arguments to pass to tool constructor.

