@@ -56,9 +56,11 @@ using ContentBlock = std::variant<TextContent, ImageContent, EmbeddedResourceCon
5656struct ToolInfo
5757{
5858 std::string name;
59+ std::optional<std::string> title; // /< Human-readable title
5960 std::optional<std::string> description;
60- fastmcpp::Json inputSchema; // /< JSON Schema for tool input
61- std::optional<fastmcpp::Json> outputSchema; // /< JSON Schema for structured output
61+ fastmcpp::Json inputSchema; // /< JSON Schema for tool input
62+ std::optional<fastmcpp::Json> outputSchema; // /< JSON Schema for structured output
63+ std::optional<std::vector<fastmcpp::Icon>> icons; // /< Icons for UI display
6264};
6365
6466// / Result of tools/list request
@@ -120,9 +122,11 @@ struct ResourceInfo
120122{
121123 std::string uri;
122124 std::string name;
125+ std::optional<std::string> title; // /< Human-readable title
123126 std::optional<std::string> description;
124127 std::optional<std::string> mimeType;
125128 std::optional<fastmcpp::Json> annotations;
129+ std::optional<std::vector<fastmcpp::Icon>> icons; // /< Icons for UI display
126130};
127131
128132// / Resource template information
@@ -131,9 +135,11 @@ struct ResourceTemplate
131135{
132136 std::string uriTemplate;
133137 std::string name;
138+ std::optional<std::string> title; // /< Human-readable title
134139 std::optional<std::string> description;
135140 std::optional<std::string> mimeType;
136141 std::optional<fastmcpp::Json> annotations;
142+ std::optional<std::vector<fastmcpp::Icon>> icons; // /< Icons for UI display
137143};
138144
139145// / Text resource content
@@ -195,8 +201,10 @@ struct PromptArgument
195201struct PromptInfo
196202{
197203 std::string name;
204+ std::optional<std::string> title; // /< Human-readable title
198205 std::optional<std::string> description;
199206 std::optional<std::vector<PromptArgument>> arguments;
207+ std::optional<std::vector<fastmcpp::Icon>> icons; // /< Icons for UI display
200208};
201209
202210// / Prompt message role
@@ -309,48 +317,97 @@ inline void from_json(const fastmcpp::Json& j, ImageContent& c)
309317inline void to_json (fastmcpp::Json& j, const ToolInfo& t)
310318{
311319 j = fastmcpp::Json{{" name" , t.name }, {" inputSchema" , t.inputSchema }};
320+ if (t.title )
321+ j[" title" ] = *t.title ;
312322 if (t.description )
313323 j[" description" ] = *t.description ;
314324 if (t.outputSchema )
315325 j[" outputSchema" ] = *t.outputSchema ;
326+ if (t.icons )
327+ j[" icons" ] = *t.icons ;
316328}
317329
318330inline void from_json (const fastmcpp::Json& j, ToolInfo& t)
319331{
320332 t.name = j.at (" name" ).get <std::string>();
333+ if (j.contains (" title" ))
334+ t.title = j[" title" ].get <std::string>();
321335 if (j.contains (" description" ))
322336 t.description = j[" description" ].get <std::string>();
323337 t.inputSchema = j.value (" inputSchema" , fastmcpp::Json::object ());
324338 if (j.contains (" outputSchema" ))
325339 t.outputSchema = j[" outputSchema" ];
340+ if (j.contains (" icons" ))
341+ t.icons = j[" icons" ].get <std::vector<fastmcpp::Icon>>();
326342}
327343
328344inline void to_json (fastmcpp::Json& j, const ResourceInfo& r)
329345{
330346 j = fastmcpp::Json{{" uri" , r.uri }, {" name" , r.name }};
347+ if (r.title )
348+ j[" title" ] = *r.title ;
331349 if (r.description )
332350 j[" description" ] = *r.description ;
333351 if (r.mimeType )
334352 j[" mimeType" ] = *r.mimeType ;
335353 if (r.annotations )
336354 j[" annotations" ] = *r.annotations ;
355+ if (r.icons )
356+ j[" icons" ] = *r.icons ;
337357}
338358
339359inline void from_json (const fastmcpp::Json& j, ResourceInfo& r)
340360{
341361 r.uri = j.at (" uri" ).get <std::string>();
342362 r.name = j.at (" name" ).get <std::string>();
363+ if (j.contains (" title" ))
364+ r.title = j[" title" ].get <std::string>();
343365 if (j.contains (" description" ))
344366 r.description = j[" description" ].get <std::string>();
345367 if (j.contains (" mimeType" ))
346368 r.mimeType = j[" mimeType" ].get <std::string>();
347369 if (j.contains (" annotations" ))
348370 r.annotations = j[" annotations" ];
371+ if (j.contains (" icons" ))
372+ r.icons = j[" icons" ].get <std::vector<fastmcpp::Icon>>();
373+ }
374+
375+ inline void to_json (fastmcpp::Json& j, const ResourceTemplate& t)
376+ {
377+ j = fastmcpp::Json{{" uriTemplate" , t.uriTemplate }, {" name" , t.name }};
378+ if (t.title )
379+ j[" title" ] = *t.title ;
380+ if (t.description )
381+ j[" description" ] = *t.description ;
382+ if (t.mimeType )
383+ j[" mimeType" ] = *t.mimeType ;
384+ if (t.annotations )
385+ j[" annotations" ] = *t.annotations ;
386+ if (t.icons )
387+ j[" icons" ] = *t.icons ;
388+ }
389+
390+ inline void from_json (const fastmcpp::Json& j, ResourceTemplate& t)
391+ {
392+ t.uriTemplate = j.at (" uriTemplate" ).get <std::string>();
393+ t.name = j.at (" name" ).get <std::string>();
394+ if (j.contains (" title" ))
395+ t.title = j[" title" ].get <std::string>();
396+ if (j.contains (" description" ))
397+ t.description = j[" description" ].get <std::string>();
398+ if (j.contains (" mimeType" ))
399+ t.mimeType = j[" mimeType" ].get <std::string>();
400+ if (j.contains (" annotations" ))
401+ t.annotations = j[" annotations" ];
402+ if (j.contains (" icons" ))
403+ t.icons = j[" icons" ].get <std::vector<fastmcpp::Icon>>();
349404}
350405
351406inline void to_json (fastmcpp::Json& j, const PromptInfo& p)
352407{
353408 j = fastmcpp::Json{{" name" , p.name }};
409+ if (p.title )
410+ j[" title" ] = *p.title ;
354411 if (p.description )
355412 j[" description" ] = *p.description ;
356413 if (p.arguments )
@@ -364,11 +421,15 @@ inline void to_json(fastmcpp::Json& j, const PromptInfo& p)
364421 j[" arguments" ].push_back (argJson);
365422 }
366423 }
424+ if (p.icons )
425+ j[" icons" ] = *p.icons ;
367426}
368427
369428inline void from_json (const fastmcpp::Json& j, PromptInfo& p)
370429{
371430 p.name = j.at (" name" ).get <std::string>();
431+ if (j.contains (" title" ))
432+ p.title = j[" title" ].get <std::string>();
372433 if (j.contains (" description" ))
373434 p.description = j[" description" ].get <std::string>();
374435 if (j.contains (" arguments" ))
@@ -384,6 +445,8 @@ inline void from_json(const fastmcpp::Json& j, PromptInfo& p)
384445 p.arguments ->push_back (arg);
385446 }
386447 }
448+ if (j.contains (" icons" ))
449+ p.icons = j[" icons" ].get <std::vector<fastmcpp::Icon>>();
387450}
388451
389452inline void from_json (const fastmcpp::Json& j, TextResourceContent& c)
0 commit comments