File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11using System . Text . Json ;
2+ using System . Text . Json . Serialization ;
23
34namespace 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}
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff 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." ) ;
You can’t perform that action at this time.
0 commit comments