yera.tools.mcp.task
Public lifecycle values for MCP tasks.
Symbols
MCPTask
Generic[ResultT]Represent an immediate or server-backed MCP tool execution.
Methods
MCPTask.async_refresh
async_refresh() → MCPTaskStateRefresh and return the latest server-reported task state.
Returns
The latest immutable task state. Immediate tasks retain their completed local state.
Raises
If a server-backed task has no refresh operation.
MCPTask.async_cancel
async_cancel() → MCPTaskStateCancel this server-backed task and return its resulting state.
Returns
The task state observed after the server acknowledges cancellation.
Raises
If the task is already complete or cannot be cancelled.
MCPTask.async_update
async_update(
input_responses: InputResponses,
) → MCPTaskStateSubmit requested input and return the resulting task state.
Parameters
Responses keyed by outstanding request identity.
Returns
The task state observed after the server accepts the responses.
Raises
If this task is not awaiting input or cannot be updated.
MCPTask.async_wait
async_wait() → ResultTWait for completion and return the converted tool result.
Returns
The converted result of the completed task.
Raises
If the task reaches a terminal state without a converted result.
MCPTask.refresh
refresh() → MCPTaskStateRefresh and return the latest server-reported task state.
MCPTask.cancel
cancel() → MCPTaskStateCancel this server-backed task and return its resulting state.
MCPTask.update
update(
input_responses: InputResponses,
) → MCPTaskStateSubmit requested input and return the resulting task state.
Parameters
Responses keyed by outstanding request identity.
Returns
The task state observed after the server accepts the responses.
MCPTask.wait
wait() → ResultTWait synchronously for completion and return the converted result.
MCPTaskState
Describe one observed state of a server-backed MCP task.
Attributes
Stable identifier minted by the MCP server.
Current lifecycle status.
Optional human-readable detail supplied by the server.
Time at which the server created the task.
Time at which the server last updated the task.
Retention duration from creation, or None when unlimited.
Server-recommended delay between status requests.