|
79 | 79 | }) |
80 | 80 | .WithTools<AddTool>() |
81 | 81 | .WithTools<AnnotatedMessageTool>() |
82 | | - .WithTools<EchoTool>() |
83 | | - .WithTools<LongRunningTool>() |
84 | | - .WithTools<PrintEnvTool>() |
85 | | - .WithTools<SampleLlmTool>() |
86 | | - .WithTools<TinyImageTool>() |
87 | 82 | .WithTools([ |
88 | | - // A tool with multiple complex icons demonstrating different themes, sizes, and MIME types |
| 83 | + // EchoTool with complex icon configuration demonstrating multiple icons, |
| 84 | + // MIME types, size specifications, and theme preferences |
89 | 85 | McpServerTool.Create( |
90 | | - WeatherTool.GetWeather, |
91 | | - new McpServerToolCreateOptions |
| 86 | + typeof(EchoTool).GetMethod(nameof(EchoTool.Echo))!, |
| 87 | + options: new McpServerToolCreateOptions |
92 | 88 | { |
93 | | - Name = "get_weather", |
94 | | - Title = "Get Weather Information", |
95 | 89 | Icons = [ |
| 90 | + // High-resolution PNG icon for light theme |
96 | 91 | new Icon |
97 | 92 | { |
98 | | - Source = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Sun/Flat/sun_flat.svg", |
| 93 | + Source = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Loudspeaker/Flat/loudspeaker_flat.svg", |
99 | 94 | MimeType = "image/svg+xml", |
100 | 95 | Sizes = ["any"], |
101 | 96 | Theme = "light" |
102 | 97 | }, |
| 98 | + // 3D icon for dark theme |
103 | 99 | new Icon |
104 | 100 | { |
105 | | - Source = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Sun/Flat/sun_flat.svg", |
106 | | - MimeType = "image/svg+xml", |
107 | | - Sizes = ["any"], |
| 101 | + Source = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Loudspeaker/3D/loudspeaker_3d.png", |
| 102 | + MimeType = "image/png", |
| 103 | + Sizes = ["256x256"], |
108 | 104 | Theme = "dark" |
109 | 105 | }, |
| 106 | + // WebP format for modern browsers |
| 107 | + // Demonstrates Data URI representation with the smallest possible valid WebP image (1x1 pixel). |
| 108 | + // This will appear as a white box when rendered by a browser at 32x32 |
110 | 109 | new Icon |
111 | 110 | { |
112 | | - Source = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==", |
113 | | - MimeType = "image/png", |
114 | | - Sizes = ["16x16", "32x32"] |
| 111 | + Source = "data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=", |
| 112 | + MimeType = "image/webp", |
| 113 | + Sizes = ["32x32"] |
115 | 114 | } |
116 | 115 | ] |
117 | 116 | }) |
118 | 117 | ]) |
| 118 | + .WithTools<LongRunningTool>() |
| 119 | + .WithTools<PrintEnvTool>() |
| 120 | + .WithTools<SampleLlmTool>() |
| 121 | + .WithTools<TinyImageTool>() |
119 | 122 | .WithPrompts<ComplexPromptType>() |
120 | 123 | .WithPrompts<SimplePromptType>() |
121 | 124 | .WithResources<SimpleResourceType>() |
|
0 commit comments