Class: MCP::Tool::OutputSchema

Inherits:
Schema
  • Object
show all
Defined in:
lib/mcp/tool/output_schema.rb

Defined Under Namespace

Classes: ValidationError

Instance Attribute Summary

Attributes inherited from Schema

#schema

Instance Method Summary collapse

Methods inherited from Schema

#==, #initialize, #to_h

Constructor Details

This class inherits a constructor from MCP::Tool::Schema

Instance Method Details

#validate_result(result) ⇒ Object



10
11
12
13
14
15
# File 'lib/mcp/tool/output_schema.rb', line 10

def validate_result(result)
  errors = fully_validate(result)
  if errors.any?
    raise ValidationError, "Invalid result: #{errors.join(", ")}"
  end
end