mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-28 02:10:38 +02:00
chore: Update SDK documentation (#2604)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
This commit is contained in:
parent
ae3c2abbf6
commit
9d5ffa86b3
55 changed files with 3213 additions and 1480 deletions
37
docs/python-sdk/fastmcp-server-tasks-routing.mdx
Normal file
37
docs/python-sdk/fastmcp-server-tasks-routing.mdx
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
title: routing
|
||||
sidebarTitle: routing
|
||||
---
|
||||
|
||||
# `fastmcp.server.tasks.routing`
|
||||
|
||||
|
||||
Task routing helper for MCP components.
|
||||
|
||||
Provides unified task mode enforcement and docket routing logic.
|
||||
|
||||
|
||||
## Functions
|
||||
|
||||
### `check_background_task` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/routing.py#L26" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
check_background_task(component: Tool | Resource | ResourceTemplate | Prompt, task_type: TaskType, key: str, arguments: dict[str, Any] | None = None) -> mcp.types.CreateTaskResult | None
|
||||
```
|
||||
|
||||
|
||||
Check task mode and submit to background if requested.
|
||||
|
||||
**Args:**
|
||||
- `component`: The MCP component
|
||||
- `task_type`: Type of task ("tool", "resource", "template", "prompt")
|
||||
- `key`: Docket registration key (caller resolves from contextvar + fallback)
|
||||
- `arguments`: Arguments for tool/prompt/template execution
|
||||
|
||||
**Returns:**
|
||||
- CreateTaskResult if submitted to docket, None for sync execution
|
||||
|
||||
**Raises:**
|
||||
- `McpError`: If mode="required" but no task metadata, or mode="forbidden"
|
||||
but task metadata is present
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue