Skip to content

Commit 9f7c564

Browse files
committed
.
Signed-off-by: He-Pin <hepin1989@gmail.com>
1 parent fab6de3 commit 9f7c564

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ private McpSchema() {
6969

7070
public static final String METHOD_NOTIFICATION_TOOLS_LIST_CHANGED = "notifications/tools/list_changed";
7171

72+
// Task Methods
73+
public static final String METHOD_TASKS_GET = "tasks/get";
74+
75+
public static final String METHOD_TASKS_LIST = "tasks/list";
76+
77+
public static final String METHOD_TASKS_RESULT = "tasks/result";
78+
79+
public static final String METHOD_TASKS_CANCEL = "tasks/cancel";
80+
81+
public static final String METHOD_NOTIFICATION_TASKS_STATUS = "notifications/tasks/status";
82+
7283
// Resources Methods
7384
public static final String METHOD_RESOURCES_LIST = "resources/list";
7485

@@ -1739,6 +1750,35 @@ public CallToolRequest build() {
17391750
}
17401751
}
17411752

1753+
/**
1754+
* Task status.
1755+
*/
1756+
enum TaskStatus {
1757+
1758+
WORKING("working"), INPUT_REQUIRED("input_required"), COMPLETED("completed"), FAILED("failed"),
1759+
CANCELLED("cancelled");
1760+
1761+
private final String value;
1762+
1763+
TaskStatus(final String value) {
1764+
this.value = value;
1765+
}
1766+
1767+
public String getValue() {
1768+
return value;
1769+
}
1770+
1771+
public static TaskStatus fromValue(String value) {
1772+
for (TaskStatus status : TaskStatus.values()) {
1773+
if (status.value.equalsIgnoreCase(value)) {
1774+
return status;
1775+
}
1776+
}
1777+
throw new IllegalArgumentException("Unknown TaskStatus value: " + value);
1778+
}
1779+
1780+
}
1781+
17421782
/**
17431783
* The server's response to a tools/call request from the client.
17441784
*

0 commit comments

Comments
 (0)