Skip to content

Commit 7ee2cca

Browse files
committed
chore: Remove task from CreateTaskResult
Signed-off-by: He-Pin <[email protected]>
1 parent 360c536 commit 7ee2cca

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

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

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,23 +2123,22 @@ public record CallToolResult( // @formatter:off
21232123
@JsonProperty("content") List<Content> content,
21242124
@JsonProperty("isError") Boolean isError,
21252125
@JsonProperty("structuredContent") Object structuredContent,
2126-
@JsonProperty("task") Task task,
21272126
@JsonProperty("_meta") Map<String, Object> meta) implements Result { // @formatter:on
21282127

21292128
/**
21302129
* @deprecated use the builder instead.
21312130
*/
21322131
@Deprecated
21332132
public CallToolResult(List<Content> content, Boolean isError) {
2134-
this(content, isError, (Object) null, null, null);
2133+
this(content, isError, (Object) null, null);
21352134
}
21362135

21372136
/**
21382137
* @deprecated use the builder instead.
21392138
*/
21402139
@Deprecated
21412140
public CallToolResult(List<Content> content, Boolean isError, Map<String, Object> structuredContent) {
2142-
this(content, isError, structuredContent, null, null);
2141+
this(content, isError, structuredContent, null);
21432142
}
21442143

21452144
/**
@@ -2156,23 +2155,6 @@ public CallToolResult(String content, Boolean isError) {
21562155
this(List.of(new TextContent(content)), isError, null);
21572156
}
21582157

2159-
/**
2160-
* Create a new instance of {@link CallToolResult} with a task.
2161-
* @param task The task metadata.
2162-
*/
2163-
public CallToolResult(Task task) {
2164-
this(null, false, null, task, null);
2165-
}
2166-
2167-
/**
2168-
* Create a new instance of {@link CallToolResult} with a task.
2169-
* @param task The task metadata.
2170-
* @param meta Optional metadata about the result.
2171-
*/
2172-
public CallToolResult(Task task, Map<String, Object> meta) {
2173-
this(null, false, null, task, meta);
2174-
}
2175-
21762158
/**
21772159
* Creates a builder for {@link CallToolResult}.
21782160
* @return a new builder instance
@@ -2192,8 +2174,6 @@ public static class Builder {
21922174

21932175
private Object structuredContent;
21942176

2195-
private Task task;
2196-
21972177
private Map<String, Object> meta;
21982178

21992179
/**
@@ -2280,17 +2260,12 @@ public Builder meta(Map<String, Object> meta) {
22802260
return this;
22812261
}
22822262

2283-
public Builder task(Task task) {
2284-
this.task = task;
2285-
return this;
2286-
}
2287-
22882263
/**
22892264
* Builds a new {@link CallToolResult} instance.
22902265
* @return a new CallToolResult instance
22912266
*/
22922267
public CallToolResult build() {
2293-
return new CallToolResult(content, isError, structuredContent, task, meta);
2268+
return new CallToolResult(content, isError, structuredContent, meta);
22942269
}
22952270

22962271
}

0 commit comments

Comments
 (0)