fastmcp.client.mixins.task_management
Task management methods for FastMCP Client.
Classes
ClientTaskManagementMixin
Mixin providing task management methods for Client.
Methods:
get_task_status
task_id: The task ID returned from call_tool_as_task
- Status information including taskId, status, pollInterval, etc.
RuntimeError: If client not connectedMcpError: If the request results in a TimeoutError | JSONRPCError
get_task_result
task_id: The task ID returned from call_tool_as_task
- The raw result (could be tool, prompt, or resource result)
RuntimeError: If client not connected, task not found, or task failedMcpError: If the request results in a TimeoutError | JSONRPCError
list_tasks
cursor: Optional pagination cursorlimit: Maximum number of tasks to return (default 50)
- Response with structure:
- tasks: List of task status dicts with taskId, status, etc.
- nextCursor: Optional cursor for next page
RuntimeError: If client not connectedMcpError: If the request results in a TimeoutError | JSONRPCError
cancel_task
task_id: The task ID to cancel
- The task status showing cancelled state
RuntimeError: If task doesn’t existMcpError: If the request results in a TimeoutError | JSONRPCError

