Skip to content

Commit 9d48361

Browse files
committed
Add docs and message field for ProgressNotification
1 parent b2d3e00 commit 9d48361

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

mcp/src/main/java/io/modelcontextprotocol/spec/McpSchema.java

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.modelcontextprotocol.util.Assert;
2222
import org.slf4j.Logger;
2323
import org.slf4j.LoggerFactory;
24+
import reactor.util.annotation.Nullable;
2425

2526
/**
2627
* Based on the <a href="http://www.jsonrpc.org/specification">JSON-RPC 2.0
@@ -755,10 +756,15 @@ private static JsonSchema parseSchema(String schema) {
755756
@JsonIgnoreProperties(ignoreUnknown = true)
756757
public record CallToolRequest(// @formatter:off
757758
@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 {
759761

760762
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);
762768
}
763769

764770
private static Map<String, Object> parseJsonArguments(String jsonArguments) {
@@ -1104,11 +1110,23 @@ public record PaginatedResult(@JsonProperty("nextCursor") String nextCursor) {
11041110
// ---------------------------
11051111
// Progress and Logging
11061112
// ---------------------------
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+
*/
11071124
@JsonIgnoreProperties(ignoreUnknown = true)
11081125
public record ProgressNotification(// @formatter:off
11091126
@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) {
11121130
}// @formatter:on
11131131

11141132
/**

0 commit comments

Comments
 (0)