microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/update-sample-to-blazor

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

core/samples/McpServer/Models.cs

37lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using System.Text.Json.Serialization;
5
6namespace McpServer;
7
8// MCP clients (and their JSON output schemas) expect snake_case field names,
9// so each positional record parameter carries an explicit JsonPropertyName.
10// The `property:` target is required: without it, the attribute would land on
11// the constructor parameter and System.Text.Json would ignore it.
12
13public sealed record NotifyResult(
14 [property: JsonPropertyName("notified")] bool Notified,
15 [property: JsonPropertyName("user_id")] string UserId);
16
17public sealed record AskResult(
18 [property: JsonPropertyName("request_id")] string RequestId);
19
20public sealed record ReplyResult(
21 [property: JsonPropertyName("status")] string Status,
22 [property: JsonPropertyName("reply")] string? Reply);
23
24public sealed record ApprovalRequestResult(
25 [property: JsonPropertyName("approval_id")] string ApprovalId);
26
27public sealed record ApprovalResult(
28 [property: JsonPropertyName("approval_id")] string ApprovalId,
29 [property: JsonPropertyName("status")] string Status);
30
31public sealed record UserMatch(
32 [property: JsonPropertyName("id")] string Id,
33 [property: JsonPropertyName("display_name")] string? DisplayName,
34 [property: JsonPropertyName("user_principal_name")] string? UserPrincipalName);
35
36public sealed record FindUserResult(
37 [property: JsonPropertyName("matches")] IReadOnlyList<UserMatch> Matches);
38