just redo all of it from scratch
This commit is contained in:
parent
0b49c3f711
commit
d80b13736e
1 changed files with 33 additions and 26 deletions
26
lib/mcp/shared/tool/input_schema.rb
Normal file
26
lib/mcp/shared/tool/input_schema.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module MCP
|
||||
class Tool
|
||||
class InputSchema
|
||||
attr_reader :properties, :required
|
||||
|
||||
def initialize(properties: {}, required: [])
|
||||
@properties = properties
|
||||
@required = required.map(&:to_sym)
|
||||
end
|
||||
|
||||
def to_h
|
||||
{ type: "object", properties:, required: }
|
||||
end
|
||||
|
||||
def missing_required_arguments?(arguments)
|
||||
missing_required_arguments(arguments).any?
|
||||
end
|
||||
|
||||
def missing_required_arguments(arguments)
|
||||
(required - arguments.keys.map(&:to_sym))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue