Add Tool output_schema support with comprehensive validation
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
This commit is contained in:
parent
3f2a4b3b21
commit
aad8e94530
1 changed files with 495 additions and 7 deletions
|
|
@ -3,12 +3,13 @@
|
|||
module MCP
|
||||
class Client
|
||||
class Tool
|
||||
attr_reader :name, :description, :input_schema
|
||||
attr_reader :name, :description, :input_schema, :output_schema
|
||||
|
||||
def initialize(name:, description:, input_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
|
||||
|
|
|
|||
Loading…
Reference in a new issue