class

Autobot::Tools::Tool

Inherits Reference < Object

Abstract base class for agent tools.

Tools are capabilities the agent can use to interact with the environment — reading files, executing commands, searching the web, etc.

Subclasses must implement name, description, parameters, and execute.

Constants

VALID_SCHEMA_TYPES = {"string", "integer", "number", "boolean", "array", "object"}

Instance methods

description
Source
execute(params : Hash(String, JSON::Any)) : ToolResult
Source
name
Source
parameters
Source
to_compact_schema

Compact schema with minimal description. Used for tools the LLM has already called (it knows what they do).

Source
to_schema

Convert tool to OpenAI function-calling schema format.

Source
validate_params(params : Hash(String, JSON::Any)) : Array(String)

Validate parameters against the tool's JSON Schema. Returns an array of error messages (empty if valid).

Source