Skip to content

Commit 0358a34

Browse files
committed
Updating from merge
1 parent 07dcebb commit 0358a34

File tree

8 files changed

+27
-14
lines changed

8 files changed

+27
-14
lines changed

samples/EverythingServer/Program.cs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,30 @@
7272

7373
var resource = ResourceGenerator.Resources[index];
7474

75-
return Task.FromResult(new ReadResourceResult
75+
if (resource.MimeType == "text/plain")
7676
{
77-
Contents = [new ResourceContents
77+
return Task.FromResult(new ReadResourceResult
78+
{
79+
Contents = [new TextResourceContents
7880
{
81+
Text = resource.Description!,
82+
MimeType = resource.MimeType,
7983
Uri = resource.Uri,
84+
}]
85+
});
86+
}
87+
else
88+
{
89+
return Task.FromResult(new ReadResourceResult
90+
{
91+
Contents = [new BlobResourceContents
92+
{
93+
Blob = resource.Description!,
8094
MimeType = resource.MimeType,
81-
Blob = resource.Description,
82-
Name = resource.Description
83-
}
84-
]
85-
});
95+
Uri = resource.Uri,
96+
}]
97+
});
98+
}
8699
})
87100
;
88101

samples/EverythingServer/Tools/AddTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace EverythingServer.Tools;
66
[McpServerToolType]
77
public static class AddTool
88
{
9-
[McpServerTool("add"), Description("Adds two numbers.")]
9+
[McpServerTool(Name = "add"), Description("Adds two numbers.")]
1010
public static string Add(int a, int b) => $"The sum of {a} and {b} is {a + b}";
1111
}

samples/EverythingServer/Tools/AnnotatedMessageTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public enum MessageType
1313
Debug,
1414
}
1515

16-
[McpServerTool("annotatedMessage"), Description("Generates an annotated message")]
16+
[McpServerTool(Name = "annotatedMessage"), Description("Generates an annotated message")]
1717
public static IEnumerable<string> AnnotatedMessage(MessageType messageType, bool includeImage = true)
1818
{
1919
throw new NotSupportedException("Unable to write annotations to the output.");

samples/EverythingServer/Tools/EchoTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace EverythingServer.Tools;
66
[McpServerToolType]
77
public static class EchoTool
88
{
9-
[McpServerTool("echo"), Description("Echoes the message back to the client.")]
9+
[McpServerTool(Name = "echo"), Description("Echoes the message back to the client.")]
1010
public static string Echo(string message) => $"Echo: {message}";
1111
}

samples/EverythingServer/Tools/LongRunningTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace EverythingServer.Tools;
88
[McpServerToolType]
99
public static class LongRunningTool
1010
{
11-
[McpServerTool("longRunningOperation"), Description("Demonstrates a long running operation with progress updates")]
11+
[McpServerTool(Name = "longRunningOperation"), Description("Demonstrates a long running operation with progress updates")]
1212
public static async Task<string> LongRunningOperation(
1313
IMcpServer server,
1414
RequestContext<CallToolRequestParams> context,

samples/EverythingServer/Tools/PrintEnvTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class PrintEnvTool
1313
WriteIndented = true
1414
};
1515

16-
[McpServerTool("printEnv"), Description("Prints all environment variables, helpful for debugging MCP server configuration")]
16+
[McpServerTool(Name = "printEnv"), Description("Prints all environment variables, helpful for debugging MCP server configuration")]
1717
public static string PrintEnv()
1818
{
1919
Debugger.Launch();

samples/EverythingServer/Tools/SampleLlmTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class SampleLlmTool(IMcpServer server)
99
{
1010
private readonly IMcpServer _server = server ?? throw new ArgumentNullException(nameof(server));
1111

12-
[McpServerTool("sampleLLM"), Description("Samples from an LLM using MCP's sampling feature")]
12+
[McpServerTool(Name = "sampleLLM"), Description("Samples from an LLM using MCP's sampling feature")]
1313
public async Task<string> SampleLLM(
1414
[Description("The prompt to send to the LLM")] string prompt,
1515
[Description("Maximum number of tokens to generate")] int maxTokens,

samples/EverythingServer/Tools/TinyImageTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace EverythingServer.Tools;
88
[McpServerToolType]
99
public static class TinyImageTool
1010
{
11-
[McpServerTool("getTinyImage"), Description("Get a tiny image from the server")]
11+
[McpServerTool(Name = "getTinyImage"), Description("Get a tiny image from the server")]
1212
public static IEnumerable<AIContent> GetTinyImage()
1313
{
1414
Debugger.Launch();

0 commit comments

Comments
 (0)