part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The experimental version of tasks in the 2025-11-25 core is still deployed on servers and hosts. It differs considerably from the modern extension (lesson 11.2): here the requestor explicitly asks for the task, the result is collected with a blocking call and there is a listing.
sampling/createMessage or elicitation/create.Server: tasks.list, tasks.cancel, tasks.requests.tools.call. Client: tasks.list, tasks.cancel, tasks.requests.sampling.createMessage, tasks.requests.elicitation.create. The requests set is exhaustive; without capabilities.tasks, do not create tasks.
Per-tool negotiation: execution.taskSupport in tools/list with "required", "optional" or "forbidden" (the default). Without the server capability, never; with it, forbidden/absent → MUST NOT (the server SHOULD return -32601 if attempted), optional → MAY, required → MUST (the server MUST return -32601 if it is not done).
{ "method": "tools/call", "params": { "name": "get_weather", "arguments": { "city": "New York" }, "task": { "ttl": 60000 } } }
CreateTaskResult response: task with taskId, status: "working", statusMessage?, createdAt, lastUpdatedAt, ttl (the receiver MAY change it; null = unlimited), pollInterval. Optional _meta["io.modelcontextprotocol/model-immediate-response"]: text to return to the model immediately.
tasks/get (taskId) → Task. Respect pollInterval; continue until terminal or input_required.tasks/result (taskId) → blocks until a terminal state and returns exactly what the original request would have returned (result or JSON-RPC error), with _meta.related-task.tasks/list (paginated) → all tasks accessible to the requestor.tasks/cancel → MUST move to cancelled before responding; reject with -32602 if already terminal; once cancelled it stays that way even if execution finishes.notifications/tasks/status (optional) with the full Task; the requestor MUST NOT depend on it.working → input_required | completed | failed | cancelled; input_required → working | terminal. Terminal states are immutable. A tool call with isError: true ends in failed.
input_requiredWhen the receiver has messages that the requestor needs, it moves to input_required; the requestor SHOULD call tasks/result pre-emptively and will receive over that stream the server's requests (e.g. elicitation/create) marked with _meta["io.modelcontextprotocol/related-task"]. Servers SHOULD NOT open SSE on tasks/get.
Every request, response and notification related to a task MUST carry io.modelcontextprotocol/related-task with { "taskId" }, except tasks/get, tasks/list and tasks/cancel (the id goes in params/result). tasks/result MUST include it in its response.
-32602: non-existent or expired taskId, invalid cursor, cancelling a terminal task. -32600: request without a task when the receiver requires one. -32603: internal. Expired tasks may be purged: "not found" is conformant.
With an authorization context, MUST bind tasks to it and reject cross-access (including tasks/list); without a context, high-entropy ids, short TTLs and SHOULD NOT declare tasks.list. Concurrency and TTL limits, clean-up, rate limiting, logs with authorization context.
tasks/result is emulated by polling tasks/get; tasks/list does not exist in modern (you would have to maintain the listing yourself); input_required changes mechanics (requests over a stream vs tasks/update).execution.taskSupport: "required", the gateway must create the task even if the host did not ask for it and materialise the result.1. In 2025-11-25 tasks, who decides that a request is executed as a task?
It is requestor-driven, bounded by capabilities and execution.taskSupport.
2. What does tasks/result do if the task is still working?
It is the blocking call that the modern extension removed.
3. What must a receiver without an authorization context do regarding tasks.list?
Listing would expose task metadata to anyone.