| 1 | using System.Text.Json; |
| 2 | using ModelContextProtocol.Protocol; |
| 3 | using Tool = ModelContextProtocol.Protocol.Tool; |
| 4 | |
| 5 | namespace AIGuiders.SampleMcp; |
| 6 | |
| 7 | internal static class ToolCatalog |
| 8 | { |
| 9 | private static JsonElement Schema(object schema) => JsonSerializer.SerializeToElement(schema); |
| 10 | |
| 11 | internal static List<Tool> Build() => |
| 12 | [ |
| 13 | new() |
| 14 | { |
| 15 | Name = "hello", |
| 16 | Description = "Example tool: returns a greeting string.", |
| 17 | InputSchema = Schema(new |
| 18 | { |
| 19 | type = "object", |
| 20 | properties = new |
| 21 | { |
| 22 | name = new { type = "string", description = "Optional name." } |
| 23 | } |
| 24 | }) |
| 25 | } |
| 26 | ]; |
| 27 | } |
| 28 | |
| 29 | |
View only · write via MCP/CIDE