class

Autobot::Tools::Registry

Inherits Reference < Object

Registry for agent tools with rate limiting

Constants

Log = ::Log.for("tools.registry")

Constructors

new(session_key : String = "default", rate_limiter : RateLimiter | Nil = nil, allowlist : Allowlist = Allowlist.all)
Source

Instance methods

allowlist
Source
clear

Clear all registered tools

Source
definitions(exclude : Array(String) | Nil = nil, compact : Array(String) | Nil = nil) : Array(Hash(String, JSON::Any))

Get all tool definitions in OpenAI/Anthropic function calling format.

  • exclude: tool names to omit entirely
  • compact: tool names to emit as compact schemas (no description). Used by progressive disclosure to save tokens for tools the LLM has already called and understands.
Source
execute(name : String, params : Hash(String, JSON::Any), session_key : String | Nil = nil) : String
Source
get(name : String) : Tool | Nil

Get a tool by name

Source
has?(name : String) : Bool

Check if a tool is registered

Source
register(tool : Tool) : Nil
Source
sandbox_executor

Get sandbox executor

Source
sandbox_executor=(executor : SandboxExecutor | Nil)

Set sandbox executor for plugin access

Source
size

Get number of registered tools

Source
tool_names

Get list of registered tool names

Source
unmatched_patterns
Source
unregister(name : String) : Nil

Unregister a tool by name

Source