Class: MicroMcp::Schema::RequiredBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/micro_mcp/schema.rb

Overview

Alternative builder for required-first syntax

Instance Method Summary collapse

Instance Method Details

#array(items_type = nil, description = nil) ⇒ Object



58
59
60
61
62
63
# File 'lib/micro_mcp/schema.rb', line 58

def array(items_type = nil, description = nil)
  schema = {type: "array"}
  schema[:items] = items_type if items_type
  schema[:description] = description if description
  schema.merge(required: true)
end

#boolean(description = nil) ⇒ Object



52
53
54
55
56
# File 'lib/micro_mcp/schema.rb', line 52

def boolean(description = nil)
  schema = {type: "boolean"}
  schema[:description] = description if description
  schema.merge(required: true)
end

#integer(description = nil) ⇒ Object



34
35
36
37
38
# File 'lib/micro_mcp/schema.rb', line 34

def integer(description = nil)
  schema = {type: "integer"}
  schema[:description] = description if description
  schema.merge(required: true)
end

#number(description = nil) ⇒ Object



46
47
48
49
50
# File 'lib/micro_mcp/schema.rb', line 46

def number(description = nil)
  schema = {type: "number"}
  schema[:description] = description if description
  schema.merge(required: true)
end

#string(description = nil) ⇒ Object



40
41
42
43
44
# File 'lib/micro_mcp/schema.rb', line 40

def string(description = nil)
  schema = {type: "string"}
  schema[:description] = description if description
  schema.merge(required: true)
end