Merge pull request #340 from koic/use_server_tools_instead_of_instance_variable_get

Use `Server#tools` instead of `instance_variable_get`
This commit is contained in:
Koichi ITO 2026-05-10 23:34:35 +09:00 • committed by GitHub
commit 9090cb6ee3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1390,7 +1390,7 @@ module MCP
Tool::Response.new({ "response" => message })
end
stored_tool = @server.instance_variable_get(:@tools)["defined_tool"]
stored_tool = @server.tools["defined_tool"]
assert_not_nil(stored_tool)
assert_equal(MCP::Tool::OutputSchema.new({ type: "object", properties: { response: { type: "string" } }, required: ["response"] }), stored_tool.output_schema)