|
21 | 21 | import io.modelcontextprotocol.util.Assert;
|
22 | 22 | import org.slf4j.Logger;
|
23 | 23 | import org.slf4j.LoggerFactory;
|
| 24 | +import reactor.util.annotation.Nullable; |
24 | 25 |
|
25 | 26 | /**
|
26 | 27 | * Based on the <a href="http://www.jsonrpc.org/specification">JSON-RPC 2.0
|
@@ -755,10 +756,15 @@ private static JsonSchema parseSchema(String schema) {
|
755 | 756 | @JsonIgnoreProperties(ignoreUnknown = true)
|
756 | 757 | public record CallToolRequest(// @formatter:off
|
757 | 758 | @JsonProperty("name") String name,
|
758 |
| - @JsonProperty("arguments") Map<String, Object> arguments) implements Request { |
| 759 | + @JsonProperty("arguments") Map<String, Object> arguments, |
| 760 | + @Nullable @JsonProperty("_meta") Map<String, Object> _meta) implements Request { |
759 | 761 |
|
760 | 762 | public CallToolRequest(String name, String jsonArguments) {
|
761 |
| - this(name, parseJsonArguments(jsonArguments)); |
| 763 | + this(name, parseJsonArguments(jsonArguments), null); |
| 764 | + } |
| 765 | + |
| 766 | + public CallToolRequest(String name, Map<String, Object> arguments) { |
| 767 | + this(name, arguments, null); |
762 | 768 | }
|
763 | 769 |
|
764 | 770 | private static Map<String, Object> parseJsonArguments(String jsonArguments) {
|
@@ -1104,11 +1110,23 @@ public record PaginatedResult(@JsonProperty("nextCursor") String nextCursor) {
|
1104 | 1110 | // ---------------------------
|
1105 | 1111 | // Progress and Logging
|
1106 | 1112 | // ---------------------------
|
| 1113 | + |
| 1114 | + /** |
| 1115 | + * The Model Context Protocol (MCP) supports optional progress tracking for long-running |
| 1116 | + * operations through notification messages. Either side can send progress notifications |
| 1117 | + * to provide updates about operation status. |
| 1118 | + * |
| 1119 | + * @param progressToken The original progress token |
| 1120 | + * @param progress The current progress value so far |
| 1121 | + * @param total An optional “total” value |
| 1122 | + * @param message An optional “message” value |
| 1123 | + */ |
1107 | 1124 | @JsonIgnoreProperties(ignoreUnknown = true)
|
1108 | 1125 | public record ProgressNotification(// @formatter:off
|
1109 | 1126 | @JsonProperty("progressToken") String progressToken,
|
1110 |
| - @JsonProperty("progress") double progress, |
1111 |
| - @JsonProperty("total") Double total) { |
| 1127 | + @JsonProperty("progress") Double progress, |
| 1128 | + @JsonProperty("total") Double total, |
| 1129 | + @JsonProperty("message") String message) { |
1112 | 1130 | }// @formatter:on
|
1113 | 1131 |
|
1114 | 1132 | /**
|
|
0 commit comments