This commit implements optional JSON Schema validation for tool outputs according to the MCP specification: - Add MCP::Tool::OutputSchema class mirroring InputSchema functionality - Support output_schema in class definitions, Tool.define, and OutputSchema objects - Include validate_result method for runtime validation - Update MCP::Client::Tool to track output schemas - Add comprehensive test coverage with 249 passing tests - Update README with dedicated Tool Output Schemas section - Follow MCP spec requirements for server/client validation
16 lines
379 B
Ruby
16 lines
379 B
Ruby
# frozen_string_literal: true
|
|
|
|
module MCP
|
|
class Client
|
|
class Tool
|
|
attr_reader :name, :description, :input_schema, :output_schema
|
|
|
|
def initialize(name:, description:, input_schema:, output_schema: nil)
|
|
@name = name
|
|
@description = description
|
|
@input_schema = input_schema
|
|
@output_schema = output_schema
|
|
end
|
|
end
|
|
end
|
|
end
|