class

Anthropic::Tool

Inherits Reference < Object

Abstract base class for tools

Tools allow Claude to use external functions during conversations. Subclass this to create custom tools, or use the Anthropic.tool helper for inline tool definitions.

Instance methods

allowed_callers

Allowed callers for this tool (beta)

Source
cache_control

Cache control for prompt caching on this tool definition

Source
call(input : JSON::Any) : String

Execute the tool with the given input (optional, for auto-execution)

Source
defer_loading?

Whether to defer loading this tool (beta)

Source
description

Human-readable description of what the tool does

Source
eager_input_streaming

Whether to enable eager input streaming for this tool (beta)

Source
input_examples

Input examples for this tool (beta)

Source
input_schema_properties

JSON Schema properties describing the tool's input parameters

Source
name

The name of the tool (used by Claude to identify it)

Source
required_properties

Override to specify which input properties are required

Source
to_definition

Convert to ToolDefinition for API requests (recommended)

Source