Module: RubyLLM::MCP::SchemaValidator

Defined in:
lib/ruby_llm/mcp/schema_validator.rb

Class Method Summary collapse

Class Method Details

.valid?(schema, data) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'lib/ruby_llm/mcp/schema_validator.rb', line 10

def valid?(schema, data)
  return true if schema.nil?

  schemer(schema).valid?(data)
rescue StandardError
  false
end

.valid_schema?(schema) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
25
# File 'lib/ruby_llm/mcp/schema_validator.rb', line 18

def valid_schema?(schema)
  return true if schema.nil?

  schemer(schema)
  true
rescue StandardError
  false
end