Interface McpTaskCreationContext
This feature is available only for a task-augmentable operation whose
request declared the MCP Tasks extension. Applications may use the admitted
request to derive their own authorization binding and must persist
getTaskOrigin() in the same transaction or outbox operation as the
durable work description. Neither this task creation context, the request context, nor any
request cancelation token is durable work and none may be retained by a
worker.
The task creation context does not schedule work, allocate a task ID, or imply that a client requested asynchronous execution. The server remains the sole per-invocation decision maker.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionReturns the admitted request that is being considered for task creation.Returns the framework-derived origin to persist with the durable task.
-
Method Details
-
getRequestContext
Returns the admitted request that is being considered for task creation.Use this context synchronously to derive an application-owned task authorization binding. Do not retain it as the durable execution context.
- Returns:
- admitted task-augmentable request
-
getTaskOrigin
Returns the framework-derived origin to persist with the durable task.When called by an interceptor for a typed tool, first access completes typed argument validation. Invalid arguments fail before an origin can be used or a tool handler can be entered.
- Returns:
- immutable non-wire task origin
- Throws:
IllegalArgumentException- if the typed tool arguments are invalid or the origin exceeds its durable bound
-