Skip to content

Commit cb64136

Browse files
committed
Readability
1 parent 1d4e28a commit cb64136

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/ModelContextProtocol/Protocol/Types/LoggingMessageNotificationParams.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Text.Json;
2+
using System.Text.Json.Serialization;
23

34
namespace ModelContextProtocol.Protocol.Types;
45

@@ -13,18 +14,18 @@ public class LoggingMessageNotificationParams
1314
/// <summary>
1415
/// The severity of this log message.
1516
/// </summary>
16-
[System.Text.Json.Serialization.JsonPropertyName("level")]
17+
[JsonPropertyName("level")]
1718
public LoggingLevel Level { get; init; }
1819

1920
/// <summary>
2021
/// An optional name of the logger issuing this message.
2122
/// </summary>
22-
[System.Text.Json.Serialization.JsonPropertyName("logger")]
23+
[JsonPropertyName("logger")]
2324
public string? Logger { get; init; }
2425

2526
/// <summary>
2627
/// The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
2728
/// </summary>
28-
[System.Text.Json.Serialization.JsonPropertyName("data")]
29+
[JsonPropertyName("data")]
2930
public JsonElement? Data { get; init; }
3031
}

src/ModelContextProtocol/Protocol/Types/SetLevelRequestParams.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace ModelContextProtocol.Protocol.Types;
1+
using System.Text.Json.Serialization;
2+
3+
namespace ModelContextProtocol.Protocol.Types;
24

35
/// <summary>
46
/// A request from the client to the server, to enable or adjust logging.
@@ -10,6 +12,6 @@ public class SetLevelRequestParams
1012
/// The level of logging that the client wants to receive from the server.
1113
/// The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.
1214
/// </summary>
13-
[System.Text.Json.Serialization.JsonPropertyName("level")]
15+
[JsonPropertyName("level")]
1416
public required LoggingLevel Level { get; init; }
1517
}

src/ModelContextProtocol/Server/McpServer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ private void SetSetLoggingLevelHandler(McpServerOptions options)
218218
{
219219
return;
220220
}
221+
221222
if (loggingCapability.SetLoggingLevelHandler is not { } setLoggingLevelHandler)
222223
{
223224
throw new McpServerException("Logging capability was enabled, but SetLoggingLevelHandler was not specified.");

0 commit comments

Comments
 (0)