Method: MCP::Tool.input_schema

Defined in:
lib/mcp/tool.rb

.input_schema(value = NOT_SET) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mcp/tool.rb', line 74

def input_schema(value = NOT_SET)
  if value == NOT_SET
    input_schema_value
  elsif value.is_a?(Hash)
    properties = value[:properties] || value["properties"] || {}
    required = value[:required] || value["required"] || []
    @input_schema_value = InputSchema.new(properties:, required:)
  elsif value.is_a?(InputSchema)
    @input_schema_value = value
  end
end