struct

Anthropic::BashTool

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

Bash tool - allows Claude to execute bash commands

An agent tool for running shell commands in a sandboxed environment. This tool is GA and does not require a beta header.

message = client.messages.create(
  model: Anthropic::Model::CLAUDE_SONNET_4_6,
  max_tokens: 4096,
  server_tools: [Anthropic::BashTool.new],
  messages: [{role: "user", content: "List the files in the current directory"}]
)

Constructors

new(pull : JSON::PullParser)

Bash tool - allows Claude to execute bash commands

An agent tool for running shell commands in a sandboxed environment. This tool is GA and does not require a beta header.

message = client.messages.create(
  model: Anthropic::Model::CLAUDE_SONNET_4_6,
  max_tokens: 4096,
  server_tools: [Anthropic::BashTool.new],
  messages: [{role: "user", content: "List the files in the current directory"}]
)
Source
new(allowed_callers : Array(String) | Nil = nil, cache_control : CacheControl | Nil = nil, defer_loading : Bool | Nil = nil, input_examples : Array(JSON::Any) | Nil = nil, strict : Bool | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

allowed_callers
Source
cache_control
Source
defer_loading
Source
input_examples
Source
name
Source
strict
Source
type
Source