|
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
|
@@ -785,10 +786,15 @@ private static JsonSchema parseSchema(String schema) {
|
785 | 786 | @JsonIgnoreProperties(ignoreUnknown = true)
|
786 | 787 | public record CallToolRequest(// @formatter:off
|
787 | 788 | @JsonProperty("name") String name,
|
788 |
| - @JsonProperty("arguments") Map<String, Object> arguments) implements Request { |
| 789 | + @JsonProperty("arguments") Map<String, Object> arguments, |
| 790 | + @Nullable @JsonProperty("_meta") Map<String, Object> _meta) implements Request { |
789 | 791 |
|
790 | 792 | public CallToolRequest(String name, String jsonArguments) {
|
791 |
| - this(name, parseJsonArguments(jsonArguments)); |
| 793 | + this(name, parseJsonArguments(jsonArguments), null); |
| 794 | + } |
| 795 | + |
| 796 | + public CallToolRequest(String name, Map<String, Object> arguments) { |
| 797 | + this(name, arguments, null); |
792 | 798 | }
|
793 | 799 |
|
794 | 800 | private static Map<String, Object> parseJsonArguments(String jsonArguments) {
|
@@ -1207,11 +1213,23 @@ public record PaginatedResult(@JsonProperty("nextCursor") String nextCursor) {
|
1207 | 1213 | // ---------------------------
|
1208 | 1214 | // Progress and Logging
|
1209 | 1215 | // ---------------------------
|
| 1216 | + |
| 1217 | + /** |
| 1218 | + * The Model Context Protocol (MCP) supports optional progress tracking for long-running |
| 1219 | + * operations through notification messages. Either side can send progress notifications |
| 1220 | + * to provide updates about operation status. |
| 1221 | + * |
| 1222 | + * @param progressToken The original progress token |
| 1223 | + * @param progress The current progress value so far |
| 1224 | + * @param total An optional “total” value |
| 1225 | + * @param message An optional “message” value |
| 1226 | + */ |
1210 | 1227 | @JsonIgnoreProperties(ignoreUnknown = true)
|
1211 | 1228 | public record ProgressNotification(// @formatter:off
|
1212 | 1229 | @JsonProperty("progressToken") String progressToken,
|
1213 |
| - @JsonProperty("progress") double progress, |
1214 |
| - @JsonProperty("total") Double total) { |
| 1230 | + @JsonProperty("progress") Double progress, |
| 1231 | + @JsonProperty("total") Double total, |
| 1232 | + @JsonProperty("message") String message) { |
1215 | 1233 | }// @formatter:on
|
1216 | 1234 |
|
1217 | 1235 | /**
|
|
0 commit comments