Skip to content

Commit dc4f83e

Browse files
committed
Add docs and message field for ProgressNotification
1 parent 9ebff0c commit dc4f83e

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
@@ -23,6 +23,7 @@
2323
import io.modelcontextprotocol.util.Assert;
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
26+
import reactor.util.annotation.Nullable;
2627

2728
/**
2829
* Based on the <a href="http://www.jsonrpc.org/specification">JSON-RPC 2.0
@@ -872,10 +873,15 @@ private static JsonSchema parseSchema(String schema) {
872873
@JsonIgnoreProperties(ignoreUnknown = true)
873874
public record CallToolRequest(// @formatter:off
874875
@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 {
876878

877879
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);
879885
}
880886

881887
private static Map<String, Object> parseJsonArguments(String jsonArguments) {
@@ -1309,11 +1315,23 @@ public record PaginatedResult(@JsonProperty("nextCursor") String nextCursor) {
13091315
// ---------------------------
13101316
// Progress and Logging
13111317
// ---------------------------
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+
*/
13121329
@JsonIgnoreProperties(ignoreUnknown = true)
13131330
public record ProgressNotification(// @formatter:off
13141331
@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) {
13171335
}// @formatter:on
13181336

13191337
/**

0 commit comments

Comments
 (0)