mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 14:04:18 +02:00
chore: Update SDK documentation
This commit is contained in:
parent
6e22914360
commit
a53030a806
2 changed files with 32 additions and 8 deletions
|
|
@ -50,7 +50,29 @@ in a Docket worker context where there's no active MCP request.
|
|||
- `McpError`: If the elicitation request fails
|
||||
|
||||
|
||||
### `handle_task_input` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/elicitation.py#L234" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `relay_elicitation` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/elicitation.py#L234" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
relay_elicitation(session: ServerSession, session_id: str, task_id: str, elicitation: dict[str, Any], fastmcp: FastMCP) -> None
|
||||
```
|
||||
|
||||
|
||||
Relay elicitation from a background task worker to the client.
|
||||
|
||||
Called by the notification subscriber when it detects an input_required
|
||||
notification with elicitation metadata. Sends a standard elicitation/create
|
||||
request to the client session, then uses handle_task_input() to push the
|
||||
response to Redis so the blocked worker can resume.
|
||||
|
||||
**Args:**
|
||||
- `session`: MCP ServerSession
|
||||
- `session_id`: Session identifier
|
||||
- `task_id`: Background task ID
|
||||
- `elicitation`: Elicitation metadata (message, requestedSchema)
|
||||
- `fastmcp`: FastMCP server instance
|
||||
|
||||
|
||||
### `handle_task_input` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/elicitation.py#L290" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
handle_task_input(task_id: str, session_id: str, action: str, content: dict[str, Any] | None, fastmcp: FastMCP) -> bool
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ require reliable delivery (input_required prompts, cancel signals).
|
|||
|
||||
## Functions
|
||||
|
||||
### `push_notification` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L46" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `push_notification` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L48" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
push_notification(session_id: str, notification: dict[str, Any], docket: Docket) -> None
|
||||
|
|
@ -43,10 +43,10 @@ that need reliable delivery across distributed processes.
|
|||
- `docket`: Docket instance for Redis access
|
||||
|
||||
|
||||
### `notification_subscriber_loop` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L74" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `notification_subscriber_loop` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L76" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
notification_subscriber_loop(session_id: str, session: ServerSession, docket: Docket) -> None
|
||||
notification_subscriber_loop(session_id: str, session: ServerSession, docket: Docket, fastmcp: FastMCP) -> None
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -64,12 +64,13 @@ This loop:
|
|||
- `session_id`: Session identifier to subscribe to
|
||||
- `session`: MCP ServerSession for sending notifications
|
||||
- `docket`: Docket instance for Redis access
|
||||
- `fastmcp`: FastMCP server instance (for elicitation relay)
|
||||
|
||||
|
||||
### `ensure_subscriber_running` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L311" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `ensure_subscriber_running` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L238" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
ensure_subscriber_running(session_id: str, session: ServerSession, docket: Docket) -> None
|
||||
ensure_subscriber_running(session_id: str, session: ServerSession, docket: Docket, fastmcp: FastMCP) -> None
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -82,9 +83,10 @@ Safe to call multiple times for the same session.
|
|||
- `session_id`: Session identifier
|
||||
- `session`: MCP ServerSession
|
||||
- `docket`: Docket instance
|
||||
- `fastmcp`: FastMCP server instance (for elicitation relay)
|
||||
|
||||
|
||||
### `stop_subscriber` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L349" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `stop_subscriber` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L278" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
stop_subscriber(session_id: str) -> None
|
||||
|
|
@ -100,7 +102,7 @@ for delivery if client reconnects (with TTL expiration).
|
|||
- `session_id`: Session identifier
|
||||
|
||||
|
||||
### `get_subscriber_count` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L369" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `get_subscriber_count` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/tasks/notifications.py#L298" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
get_subscriber_count() -> int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue