|
23 | 23 | import io.modelcontextprotocol.util.Assert; |
24 | 24 | import org.slf4j.Logger; |
25 | 25 | import org.slf4j.LoggerFactory; |
| 26 | +import reactor.util.annotation.Nullable; |
26 | 27 |
|
27 | 28 | /** |
28 | 29 | * Based on the <a href="http://www.jsonrpc.org/specification">JSON-RPC 2.0 |
@@ -872,10 +873,15 @@ private static JsonSchema parseSchema(String schema) { |
872 | 873 | @JsonIgnoreProperties(ignoreUnknown = true) |
873 | 874 | public record CallToolRequest(// @formatter:off |
874 | 875 | @JsonProperty("name") String name, |
875 | | - @JsonProperty("arguments") Map<String, Object> arguments) implements Request { |
| 876 | + @JsonProperty("arguments") Map<String, Object> arguments, |
| 877 | + @Nullable @JsonProperty("_meta") Map<String, Object> _meta) implements Request { |
876 | 878 |
|
877 | 879 | public CallToolRequest(String name, String jsonArguments) { |
878 | | - this(name, parseJsonArguments(jsonArguments)); |
| 880 | + this(name, parseJsonArguments(jsonArguments), null); |
| 881 | + } |
| 882 | + |
| 883 | + public CallToolRequest(String name, Map<String, Object> arguments) { |
| 884 | + this(name, arguments, null); |
879 | 885 | } |
880 | 886 |
|
881 | 887 | private static Map<String, Object> parseJsonArguments(String jsonArguments) { |
@@ -1309,11 +1315,23 @@ public record PaginatedResult(@JsonProperty("nextCursor") String nextCursor) { |
1309 | 1315 | // --------------------------- |
1310 | 1316 | // Progress and Logging |
1311 | 1317 | // --------------------------- |
| 1318 | + |
| 1319 | + /** |
| 1320 | + * The Model Context Protocol (MCP) supports optional progress tracking for long-running |
| 1321 | + * operations through notification messages. Either side can send progress notifications |
| 1322 | + * to provide updates about operation status. |
| 1323 | + * |
| 1324 | + * @param progressToken The original progress token |
| 1325 | + * @param progress The current progress value so far |
| 1326 | + * @param total An optional “total” value |
| 1327 | + * @param message An optional “message” value |
| 1328 | + */ |
1312 | 1329 | @JsonIgnoreProperties(ignoreUnknown = true) |
1313 | 1330 | public record ProgressNotification(// @formatter:off |
1314 | 1331 | @JsonProperty("progressToken") String progressToken, |
1315 | | - @JsonProperty("progress") double progress, |
1316 | | - @JsonProperty("total") Double total) { |
| 1332 | + @JsonProperty("progress") Double progress, |
| 1333 | + @JsonProperty("total") Double total, |
| 1334 | + @JsonProperty("message") String message) { |
1317 | 1335 | }// @formatter:on |
1318 | 1336 |
|
1319 | 1337 | /** |
|
0 commit comments