struct

Anthropic::TextEditorTool

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

Text editor tool - allows Claude to view and edit files

An agent tool for reading and modifying text files. 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::TextEditorTool.new],
  messages: [{role: "user", content: "Read the contents of config.yml"}]
)

Constructors

new(pull : JSON::PullParser)

Text editor tool - allows Claude to view and edit files

An agent tool for reading and modifying text files. 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::TextEditorTool.new],
  messages: [{role: "user", content: "Read the contents of config.yml"}]
)
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, max_characters : Int32 | 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
max_characters

Optional: Maximum number of characters the tool can process

Source
name
Source
strict
Source
type
Source