@@ -336,10 +336,14 @@ def test_tools_sends_request_to_transport_and_returns_tools_array
336336 "tools" => [
337337 {
338338 "name" => "tool1" ,
339+ "title" => "First tool" ,
339340 "description" => "tool1" ,
340341 "inputSchema" => { } ,
341342 "outputSchema" => { "type" => "object" , "properties" => { "result" => { "type" => "string" } } } ,
342343 "annotations" => { "readOnlyHint" => true , "title" => "Tool One" } ,
344+ "icons" => [ { "src" => "https://example.com/tool1.png" , "mimeType" => "image/png" } ] ,
345+ "execution" => { "taskSupport" => "optional" } ,
346+ "_meta" => { "ui" => { "resourceUri" => "ui://shop/plans" , "visibility" => [ "model" , "app" ] } } ,
343347 } ,
344348 { "name" => "tool2" , "description" => "tool2" , "inputSchema" => { } } ,
345349 ] ,
@@ -358,9 +362,18 @@ def test_tools_sends_request_to_transport_and_returns_tools_array
358362 assert_equal ( "tool1" , tools . first . name )
359363 assert_equal ( { "type" => "object" , "properties" => { "result" => { "type" => "string" } } } , tools . first . output_schema )
360364 assert_equal ( { "readOnlyHint" => true , "title" => "Tool One" } , tools . first . annotations )
365+ # Kept as sent: an MCP Apps host reads the tool's app from `_meta.ui`.
366+ assert_equal ( "First tool" , tools . first . title )
367+ assert_equal ( [ { "src" => "https://example.com/tool1.png" , "mimeType" => "image/png" } ] , tools . first . icons )
368+ assert_equal ( { "taskSupport" => "optional" } , tools . first . execution )
369+ assert_equal ( { "ui" => { "resourceUri" => "ui://shop/plans" , "visibility" => [ "model" , "app" ] } } , tools . first . meta )
361370 assert_equal ( "tool2" , tools . last . name )
362371 assert_nil ( tools . last . output_schema )
363372 assert_nil ( tools . last . annotations )
373+ assert_nil ( tools . last . title )
374+ assert_nil ( tools . last . icons )
375+ assert_nil ( tools . last . execution )
376+ assert_nil ( tools . last . meta )
364377 end
365378
366379 def test_tools_returns_empty_array_when_no_tools
0 commit comments