File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -731,6 +731,28 @@ class Client
731731 rt.mimeType = r[" mimeType" ].get <std::string>();
732732 if (r.contains (" annotations" ))
733733 rt.annotations = r[" annotations" ];
734+ if (r.contains (" title" ))
735+ rt.title = r[" title" ].get <std::string>();
736+ if (r.contains (" icons" ))
737+ {
738+ std::vector<fastmcpp::Icon> icons;
739+ for (const auto & icon : r[" icons" ])
740+ {
741+ fastmcpp::Icon i;
742+ i.src = icon.at (" src" ).get <std::string>();
743+ if (icon.contains (" mimeType" ))
744+ i.mime_type = icon[" mimeType" ].get <std::string>();
745+ if (icon.contains (" sizes" ))
746+ {
747+ std::vector<std::string> sizes;
748+ for (const auto & s : icon[" sizes" ])
749+ sizes.push_back (s.get <std::string>());
750+ i.sizes = sizes;
751+ }
752+ icons.push_back (i);
753+ }
754+ rt.icons = icons;
755+ }
734756 result.resourceTemplates .push_back (rt);
735757 }
736758 }
Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ void test_list_tools()
1212
1313 auto tools = c.list_tools ();
1414
15- assert (tools.size () == 6 );
15+ assert (tools.size () == 7 );
1616 assert (tools[0 ].name == " add" );
1717 assert (tools[0 ].description .value_or (" " ) == " Add two numbers" );
1818 assert (tools[1 ].name == " greet" );
1919
20- std::cout << " [PASS] list_tools() returns 6 tools\n " ;
20+ std::cout << " [PASS] list_tools() returns 7 tools\n " ;
2121}
2222
2323void test_list_tools_mcp ()
@@ -29,7 +29,7 @@ void test_list_tools_mcp()
2929
3030 auto result = c.list_tools_mcp ();
3131
32- assert (result.tools .size () == 6 );
32+ assert (result.tools .size () == 7 );
3333 assert (!result.nextCursor .has_value ()); // No pagination in this test
3434
3535 std::cout << " [PASS] list_tools_mcp() returns ListToolsResult\n " ;
You can’t perform that action at this time.
0 commit comments