MCP Tasks: Long-Running Tools Without Timeouts

On November 11, 2026, the Model Context Protocol team announced that spec revisions move to a fixed six-month cadence, with the next one targeted at 2027-03-30. Read that next to the extensions framework introduced in the 2026-07-28 revision and a direction becomes clear: the core protocol slows down on purpose, and new capability arrives as opt-in extensions. The most useful one shipping today is Tasks — io.modelcontextprotocol/tasks — which replaces a held-open request with a durable handle.

The problem: work that outlives its request

A tool call is request and response. That shape fits a database read. It does not fit a deployment, a video render, a schema migration, or an agentic job that legitimately runs for forty minutes. Those get modelled as tool calls anyway, and the failure mode is familiar: the transport times out, the client retries, the work runs twice, and a client restart loses the only reference to a job still burning compute on the server.

The workaround was to return a job id as plain text and let the model infer a polling convention from a docstring. Every server invented its own, and no client could reason about any of them.

What changed

Tasks moves the handle into the protocol. Instead of a CallToolResult, a server may answer a tools/call with a CreateTaskResult, marked by resultType: "task" and carrying taskId, status, createdAt, lastUpdatedAt, ttlMs, and an optional pollIntervalMs. Four methods cover the rest of the lifecycle:

  • tasks/get — poll current state; terminal states carry result or error
  • tasks/update — answer outstanding input requests
  • tasks/cancel — request cancellation, cooperatively
  • notifications/tasks — server push, for clients that subscribe through subscriptions/listen

The statuses are working, input_required, completed, cancelled, and failed; the last three are terminal. Task-augmented execution applies to tools/call only, and the spec asks servers to design for more request types later.

The server decides per request whether to create a task, but only for a client that opted in. Support is declared on every request:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "render_video",
    "arguments": { "sceneId": "intro-01" },
    "_meta": {
      "io.modelcontextprotocol/clientCapabilities": {
        "extensions": { "io.modelcontextprotocol/tasks": {} }
      }
    }
  }
}

A server that does not see that declaration MUST NOT return a task; if it cannot serve the call synchronously either, it answers with error -32021, Missing Required Client Capability. Equally strict in the other direction: the task MUST be durably created before the response goes out, so a tasks/get for that taskId already resolves.

Polling, in practice

ts
async function runTask(client, name, args) {
  const res = await client.callTool({ name, arguments: args });
  if (res.resultType !== "task") return res;

  let task = res;
  while (task.status === "working" || task.status === "input_required") {
    if (task.status === "input_required") {
      await client.request("tasks/update", {
        taskId: task.taskId,
        inputResponses: {
          [Object.keys(task.inputRequests)[0]]: {
            action: "accept",
            content: { input: "approved" }
          }
        }
      });
    }
    await sleep(task.pollIntervalMs ?? 5000);
    task = await client.request("tasks/get", { taskId: task.taskId });
  }

  if (task.status === "completed") return task.result;
  throw new Error(task.error?.message ?? `task ${task.status}`);
}

Persist taskId before the first poll. That single line is what turns a crash from lost work into a resumed poll.

Caveats worth designing for

TTL is the server's call. ttlMs counts from creation, may change during the task's life, and may be null for unlimited. After it elapses the server may mark the task failed or delete it outright — a later tasks/get returning -32602 for an expired task is compliant, not a bug.

Cancellation is a request, not a guarantee. The server must acknowledge tasks/cancel with an empty result, but may finish the work anyway and land in a non-cancelled status. notifications/cancelled must not be used here.

Treat `inputRequests` as untrusted input. Each entry carries the same trust model as a standalone server request, which means host approval policy applies per entry — not once for the parent call. Keys are unique for the task's lifetime, so deduplicate across polls.

Task ids are close to credentials. The spec requires enough entropy that they cannot be guessed or enumerated, permits servers to treat them as bearer tokens, and requires authorization on every task request. There is deliberately no tasks/list, so one caller cannot discover another's work. Over Streamable HTTP, the Mcp-Name header must carry the taskId.

Errors split two ways. A tool that fails its own job returns completed with isError: true. The failed status is reserved for JSON-RPC errors.

Takeaway

Tasks is a small protocol surface that removes a whole class of hand-rolled glue. For anyone building agentic systems, the move is to make durable handles the default for any tool that can exceed a few seconds, and to treat polling state as something worth persisting. Extensions, not spec revisions, are now where this kind of capability lands — which makes reading them part of the job.

Related: MCP File Uploads: A Standard Way to Move Files covers another extension built on the same framework.

Primary source: MCP Tasks extension specification, revision 2026-07-28