Skip to content

Commit c6f6ea1

Browse files
committed
Add docs and message field for ProgressNotification
1 parent 9a63538 commit c6f6ea1

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
@@ -785,10 +786,15 @@ private static JsonSchema parseSchema(String schema) {
785786
@JsonIgnoreProperties(ignoreUnknown = true)
786787
public record CallToolRequest(// @formatter:off
787788
@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 {
789791

790792
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);
792798
}
793799

794800
private static Map<String, Object> parseJsonArguments(String jsonArguments) {
@@ -1207,11 +1213,23 @@ public record PaginatedResult(@JsonProperty("nextCursor") String nextCursor) {
12071213
// ---------------------------
12081214
// Progress and Logging
12091215
// ---------------------------
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+
*/
12101227
@JsonIgnoreProperties(ignoreUnknown = true)
12111228
public record ProgressNotification(// @formatter:off
12121229
@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) {
12151233
}// @formatter:on
12161234

12171235
/**

0 commit comments

Comments
 (0)