fixes input schema validation for schemas without required fields

This commit is contained in:
Jens Kraemer 2025-07-11 11:27:59 +02:00
commit 271ccb43d0

View file

@ -40,6 +40,12 @@ module MCP
end
end
test "schema without required arguments is valid" do
assert_nothing_raised do
InputSchema.new(properties: { foo: { type: "string" } })
end
end
test "validate arguments with valid data" do
schema = InputSchema.new(properties: { foo: { type: "string" } }, required: [:foo])
assert_nil(schema.validate_arguments({ foo: "bar" }))