struct

Anthropic::AdvisorTool

Inherits JSON::Serializable < Anthropic::ServerTool < JSON::Serializable < Struct < Value < Object

Advisor tool — delegates questions to a secondary model at runtime.

A server-side "tool" that lets the primary model consult a specified advisor model on demand. Useful for routing specialized questions to a different model within the same conversation.

Requires the beta header advisor-tool-2026-03-01.

message = client.beta.messages.create(
  betas: [Anthropic::ADVISOR_TOOL_BETA],
  model: Anthropic::Model::CLAUDE_OPUS_4_7,
  max_tokens: 1024,
  server_tools: [Anthropic::AdvisorTool.new(model: Anthropic::Model::CLAUDE_HAIKU_4_5)],
  messages: [{role: "user", content: "Check this code for vulnerabilities."}]
)

Constructors

new(pull : JSON::PullParser)

Advisor tool — delegates questions to a secondary model at runtime.

A server-side "tool" that lets the primary model consult a specified advisor model on demand. Useful for routing specialized questions to a different model within the same conversation.

Requires the beta header advisor-tool-2026-03-01.

message = client.beta.messages.create(
  betas: [Anthropic::ADVISOR_TOOL_BETA],
  model: Anthropic::Model::CLAUDE_OPUS_4_7,
  max_tokens: 1024,
  server_tools: [Anthropic::AdvisorTool.new(model: Anthropic::Model::CLAUDE_HAIKU_4_5)],
  messages: [{role: "user", content: "Check this code for vulnerabilities."}]
)
Source
new(model : String, allowed_callers : Array(String) | Nil = nil, cache_control : CacheControl | Nil = nil, caching : CacheControl | Nil = nil, defer_loading : Bool | Nil = nil, max_uses : Int32 | Nil = nil, strict : Bool | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

beta_header
Source

Instance methods

allowed_callers

Allowed callers for the advisor tool. Valid values include "direct", "code_execution_20250825", "code_execution_20260120", and "code_execution_20260521".

Source
cache_control
Source
caching

Caching configuration for the advisor's own prompt.

Source
defer_loading
Source
max_uses
Source
model

The model that will answer advisor calls.

Source
name
Source
strict
Source
type
Source