ext-tasks/schema/draft/2025-11-25/schema.json
Caitie McCaffrey 5cac9229cf Use SDK imports for TypeScript and remote refs for JSON Schema
- schema.ts: Import core MCP types from @modelcontextprotocol/sdk/types.js
  instead of inline stubs
- schema.json: Use remote \ URIs pointing to core MCP schema at
  https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/
  main/schema/2025-11-25/schema.json
- Add package.json with SDK and TypeScript as devDependencies
- Add .gitignore for node_modules
- Add skipLibCheck to tsconfig.json
- Add index signature to TaskStatusNotificationParams for SDK type compat

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 14:37:49 -07:00

374 lines
13 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "MCP Tasks Extension Schema. Contains only task-related definitions from the MCP 2025-11-25 specification. Core MCP types are referenced via remote $ref pointing to the 2025-11-25 core schema.",
"$comment": "Extension Identifier: io.modelcontextprotocol/tasks. Core schema: https://github.com/modelcontextprotocol/modelcontextprotocol/tree/2025-11-25/schema/2025-11-25",
"$defs": {
"TaskStatus": {
"description": "The status of a task.",
"enum": ["cancelled", "completed", "failed", "input_required", "working"],
"type": "string"
},
"TaskMetadata": {
"description": "Metadata for augmenting a request with task execution.\nInclude this in the `task` field of the request parameters.",
"properties": {
"ttl": {
"description": "Requested duration in milliseconds to retain task from creation.",
"type": "integer"
}
},
"type": "object"
},
"RelatedTaskMetadata": {
"description": "Metadata for associating messages with a task.\nInclude this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.",
"properties": {
"taskId": {
"description": "The task identifier this message is associated with.",
"type": "string"
}
},
"required": ["taskId"],
"type": "object"
},
"Task": {
"description": "Data associated with a task.",
"properties": {
"createdAt": {
"description": "ISO 8601 timestamp when the task was created.",
"type": "string"
},
"lastUpdatedAt": {
"description": "ISO 8601 timestamp when the task was last updated.",
"type": "string"
},
"pollInterval": {
"description": "Suggested polling interval in milliseconds.",
"type": "integer"
},
"status": {
"$ref": "#/$defs/TaskStatus",
"description": "Current task state."
},
"statusMessage": {
"description": "Optional human-readable message describing the current task state.\nThis can provide context for any status, including:\n- Reasons for \"cancelled\" status\n- Summaries for \"completed\" status\n- Diagnostic information for \"failed\" status (e.g., error details, what went wrong)",
"type": "string"
},
"taskId": {
"description": "The task identifier.",
"type": "string"
},
"ttl": {
"description": "Actual retention duration from creation in milliseconds, null for unlimited.",
"type": ["integer", "null"]
}
},
"required": ["createdAt", "lastUpdatedAt", "status", "taskId", "ttl"],
"type": "object"
},
"CreateTaskResult": {
"description": "A response to a task-augmented request.",
"properties": {
"_meta": {
"additionalProperties": {},
"description": "See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.",
"type": "object"
},
"task": {
"$ref": "#/$defs/Task"
}
},
"required": ["task"],
"type": "object"
},
"TaskAugmentedRequestParams": {
"description": "Common params for any task-augmented request.",
"properties": {
"_meta": {
"additionalProperties": {},
"description": "See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.",
"properties": {
"progressToken": {
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/ProgressToken",
"description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications."
}
},
"type": "object"
},
"task": {
"$ref": "#/$defs/TaskMetadata",
"description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities."
}
},
"type": "object"
},
"GetTaskRequest": {
"description": "A request to retrieve the state of a task.",
"properties": {
"id": {
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/RequestId"
},
"jsonrpc": {
"const": "2.0",
"type": "string"
},
"method": {
"const": "tasks/get",
"type": "string"
},
"params": {
"properties": {
"taskId": {
"description": "The task identifier to query.",
"type": "string"
}
},
"required": ["taskId"],
"type": "object"
}
},
"required": ["id", "jsonrpc", "method", "params"],
"type": "object"
},
"GetTaskResult": {
"allOf": [
{
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/Result"
},
{
"$ref": "#/$defs/Task"
}
],
"description": "The response to a tasks/get request."
},
"GetTaskPayloadRequest": {
"description": "A request to retrieve the result of a completed task.",
"properties": {
"id": {
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/RequestId"
},
"jsonrpc": {
"const": "2.0",
"type": "string"
},
"method": {
"const": "tasks/result",
"type": "string"
},
"params": {
"properties": {
"taskId": {
"description": "The task identifier to retrieve results for.",
"type": "string"
}
},
"required": ["taskId"],
"type": "object"
}
},
"required": ["id", "jsonrpc", "method", "params"],
"type": "object"
},
"GetTaskPayloadResult": {
"additionalProperties": {},
"description": "The response to a tasks/result request.\nThe structure matches the result type of the original request.\nFor example, a tools/call task would return the CallToolResult structure.",
"properties": {
"_meta": {
"additionalProperties": {},
"description": "See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.",
"type": "object"
}
},
"type": "object"
},
"CancelTaskRequest": {
"description": "A request to cancel a task.",
"properties": {
"id": {
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/RequestId"
},
"jsonrpc": {
"const": "2.0",
"type": "string"
},
"method": {
"const": "tasks/cancel",
"type": "string"
},
"params": {
"properties": {
"taskId": {
"description": "The task identifier to cancel.",
"type": "string"
}
},
"required": ["taskId"],
"type": "object"
}
},
"required": ["id", "jsonrpc", "method", "params"],
"type": "object"
},
"CancelTaskResult": {
"allOf": [
{
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/Result"
},
{
"$ref": "#/$defs/Task"
}
],
"description": "The response to a tasks/cancel request."
},
"ListTasksRequest": {
"description": "A request to retrieve a list of tasks.",
"properties": {
"id": {
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/RequestId"
},
"jsonrpc": {
"const": "2.0",
"type": "string"
},
"method": {
"const": "tasks/list",
"type": "string"
},
"params": {
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/PaginatedRequestParams"
}
},
"required": ["id", "jsonrpc", "method"],
"type": "object"
},
"ListTasksResult": {
"description": "The response to a tasks/list request.",
"properties": {
"_meta": {
"additionalProperties": {},
"description": "See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.",
"type": "object"
},
"nextCursor": {
"description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
"type": "string"
},
"tasks": {
"items": {
"$ref": "#/$defs/Task"
},
"type": "array"
}
},
"required": ["tasks"],
"type": "object"
},
"TaskStatusNotificationParams": {
"allOf": [
{
"$ref": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/2025-11-25/schema.json#/$defs/NotificationParams"
},
{
"$ref": "#/$defs/Task"
}
],
"description": "Parameters for a `notifications/tasks/status` notification."
},
"TaskStatusNotification": {
"description": "An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications.",
"properties": {
"jsonrpc": {
"const": "2.0",
"type": "string"
},
"method": {
"const": "notifications/tasks/status",
"type": "string"
},
"params": {
"$ref": "#/$defs/TaskStatusNotificationParams"
}
},
"required": ["jsonrpc", "method", "params"],
"type": "object"
},
"TaskServerCapabilities": {
"description": "Task-related server capabilities. Include this in the server's capabilities object during initialization.",
"properties": {
"tasks": {
"properties": {
"list": {
"description": "Whether this server supports tasks/list.",
"type": "object"
},
"cancel": {
"description": "Whether this server supports tasks/cancel.",
"type": "object"
},
"requests": {
"properties": {
"tools": {
"properties": {
"call": {
"description": "Whether the server supports task-augmented tools/call requests.",
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"TaskClientCapabilities": {
"description": "Task-related client capabilities. Include this in the client's capabilities object during initialization.",
"properties": {
"tasks": {
"properties": {
"list": {
"description": "Whether this client supports tasks/list.",
"type": "object"
},
"cancel": {
"description": "Whether this client supports tasks/cancel.",
"type": "object"
},
"requests": {
"properties": {
"sampling": {
"properties": {
"createMessage": {
"description": "Whether the client supports task-augmented sampling/createMessage requests.",
"type": "object"
}
},
"type": "object"
},
"elicitation": {
"properties": {
"create": {
"description": "Whether the client supports task-augmented elicitation/create requests.",
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"ToolTaskSupport": {
"description": "Task support declaration for individual tools.\n- \"forbidden\": Tool does not support task-augmented execution (default when absent)\n- \"optional\": Tool may support task-augmented execution\n- \"required\": Tool requires task-augmented execution",
"enum": ["forbidden", "optional", "required"],
"type": "string"
}
}
}