Skip to content

Commit a54a328

Browse files
committed
Add complex icon configuration for Echo tool
1 parent 8ad9d68 commit a54a328

File tree

2 files changed

+20
-32
lines changed

2 files changed

+20
-32
lines changed

samples/EverythingServer/Program.cs

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,43 +79,46 @@
7979
})
8080
.WithTools<AddTool>()
8181
.WithTools<AnnotatedMessageTool>()
82-
.WithTools<EchoTool>()
83-
.WithTools<LongRunningTool>()
84-
.WithTools<PrintEnvTool>()
85-
.WithTools<SampleLlmTool>()
86-
.WithTools<TinyImageTool>()
8782
.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
8985
McpServerTool.Create(
90-
WeatherTool.GetWeather,
91-
new McpServerToolCreateOptions
86+
typeof(EchoTool).GetMethod(nameof(EchoTool.Echo))!,
87+
options: new McpServerToolCreateOptions
9288
{
93-
Name = "get_weather",
94-
Title = "Get Weather Information",
9589
Icons = [
90+
// High-resolution PNG icon for light theme
9691
new Icon
9792
{
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",
9994
MimeType = "image/svg+xml",
10095
Sizes = ["any"],
10196
Theme = "light"
10297
},
98+
// 3D icon for dark theme
10399
new Icon
104100
{
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"],
108104
Theme = "dark"
109105
},
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
110109
new Icon
111110
{
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"]
115114
}
116115
]
117116
})
118117
])
118+
.WithTools<LongRunningTool>()
119+
.WithTools<PrintEnvTool>()
120+
.WithTools<SampleLlmTool>()
121+
.WithTools<TinyImageTool>()
119122
.WithPrompts<ComplexPromptType>()
120123
.WithPrompts<SimplePromptType>()
121124
.WithResources<SimpleResourceType>()

samples/EverythingServer/Tools/WeatherTool.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)