class RubyLLM::ActiveRecord::ToolCall

A tool call a message requested, in RubyLLM’s ruby_llm_tool_calls table. An assistant message reaches its calls through ruby_llm_tool_calls, oldest first, and a tool message reaches the call it answers through ruby_llm_parent_tool_call.

message.ruby_llm_tool_calls.pluck(:name) # => ["weather", "search"]
RubyLLM::ActiveRecord::ToolCall.where(name: "weather").count

Each row belongs to message, the assistant message that requested it, and to result, the tool message that answers it once there is one. Both associations are polymorphic. Its columns:

tool_call_id

The call’s id, unique across the table.

name

The tool’s name.

namespace

The namespace of a namespaced tool, or nil.

arguments

The arguments the model passed, as a Hash.

approval

"pending", "approved", "remembered", or "denied", or nil when no approval was asked.

remote

Whether the provider ran the tool instead of RubyLLM.

RubyLLM writes these rows. Read and query them, and add scopes and columns of your own, but do not create or update them.