struct

Anthropic::InputSchema

Inherits JSON::Serializable < Struct < Value < Object

JSON Schema for tool input parameters

Wraps a properties hash in the required object structure for the API.

schema = InputSchema.new(
  properties: {
    "location" => Schema.string("City name"),
    "unit"     => Schema.enum("celsius", "fahrenheit"),
  },
  required: ["location"]
)

Constructors

build(properties : Hash(String, Schema::Property), required : Array(String) = [] of String) : self

Create from a Hash(String, Schema::Property) with required fields

Source
new(properties : Hash(String, Schema::Property), required : Array(String) | Nil = nil, additional_properties : Bool = false)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

additional_properties?
Source
properties
Source
required
Source
type
Source