Merge pull request #445 from rickreyhsig-wealthbox/client-tool-annotations

Expose server tool annotations on MCP::Client::Tool
This commit is contained in:
Koichi ITO 2026-07-28 01:21:53 +09:00 • committed by GitHub
commit 5a879b3678
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,6 +124,7 @@ module MCP
"description" => "tool1",
"inputSchema" => {},
"outputSchema" => { "type" => "object", "properties" => { "result" => { "type" => "string" } } },
"annotations" => { "readOnlyHint" => true, "title" => "Tool One" },
},
{ "name" => "tool2", "description" => "tool2", "inputSchema" => {} },
],
@ -141,8 +142,10 @@ module MCP
assert_equal(2, tools.size)
assert_equal("tool1", tools.first.name)
assert_equal({ "type" => "object", "properties" => { "result" => { "type" => "string" } } }, tools.first.output_schema)
assert_equal({ "readOnlyHint" => true, "title" => "Tool One" }, tools.first.annotations)
assert_equal("tool2", tools.last.name)
assert_nil(tools.last.output_schema)
assert_nil(tools.last.annotations)
end
def test_tools_returns_empty_array_when_no_tools