class

MCP::Protocol::ElicitationSchemaBuilder

Inherits Reference < Object

Fluent builder for ElicitationSchema.

Convenience methods auto-wrap each primitive schema type:

builder.required_email("email")         # StringSchema with format: "email"
builder.required_integer("age", 0, 150) # IntegerSchema with range 0..150
builder.optional_bool("opt_in", false)  # BooleanSchema, default false

Call build when all properties are added.

Instance methods

build

Finalize and produce the schema. Empty required is omitted.

Source
description(val : String) : self
Source
optional_bool(name : String, default : Bool) : self

Add an optional boolean property with a default.

Source
optional_integer(name : String, min : Int64, max : Int64) : self

Add an optional integer property with inclusive range.

Source
optional_string(name : String) : self

Add an optional plain string property.

Source
required_bool(name : String) : self

Add a required boolean property.

Source
required_email(name : String) : self

Add a required email-format string property.

Source
required_integer(name : String, min : Int64, max : Int64) : self

Add a required integer property with inclusive range.

Source
required_string(name : String) : self

Add a required plain string property.

Source
title(val : String) : self
Source