fastmcp.server.tasks.routing
Task routing helper for MCP components.
Provides unified task mode enforcement and docket routing logic.
Functions
check_background_task
component: The MCP componenttask_type: Type of task (“tool”, “resource”, “template”, “prompt”)arguments: Arguments for tool/prompt/template executiontask_meta: Task execution metadata. If provided, execute as background task.
- CreateTaskResult if submitted to docket, None for sync execution
McpError: If mode=“required” but no task metadata, or mode=“forbidden” but task metadata is present

