Skip to content

Commit 37fb0ad

Browse files
chore: Update SDK documentation (#4615)
1 parent cb5f6ab commit 37fb0ad

4 files changed

Lines changed: 16 additions & 72 deletions

File tree

docs/python-sdk/fastmcp-dependencies.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This module re-exports dependency injection symbols to provide a clean,
1212
centralized import location for all dependency-related functionality.
1313

1414
DI features (Depends, CurrentContext, CurrentFastMCP) work without pydocket
15-
using the uncalled-for DI engine. Only task-related dependencies (CurrentDocket,
16-
CurrentWorker) and background task execution require fastmcp[tasks].
15+
using the uncalled-for DI engine. The docket-specific dependencies
16+
(``CurrentDocket``, ``CurrentWorker``) live in the ``fastmcp-tasks`` package
17+
(``fastmcp_tasks.dependencies``).
1718

docs/python-sdk/fastmcp-settings.mdx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,15 @@ sidebarTitle: settings
77

88
## Classes
99

10-
### `DocketSettings` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L33" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
11-
12-
13-
Docket worker configuration.
14-
15-
16-
### `Settings` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L136" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
10+
### `Settings` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L32" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
1711

1812

1913
FastMCP settings.
2014

2115

2216
**Methods:**
2317

24-
#### `get_setting` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L148" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
18+
#### `get_setting` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L44" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
2519

2620
```python
2721
get_setting(self, attr: str) -> Any
@@ -31,7 +25,7 @@ Get a setting. If the setting contains one or more `__`, it will be
3125
treated as a nested setting.
3226

3327

34-
#### `set_setting` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L161" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
28+
#### `set_setting` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L57" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
3529

3630
```python
3731
set_setting(self, attr: str, value: Any) -> None
@@ -41,7 +35,7 @@ Set a setting. If the setting contains one or more `__`, it will be
4135
treated as a nested setting.
4236

4337

44-
#### `normalize_log_level` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L183" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
38+
#### `normalize_log_level` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/settings.py#L79" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
4539

4640
```python
4741
normalize_log_level(cls, v)

docs/python-sdk/fastmcp-utilities-components.mdx

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebarTitle: components
77

88
## Functions
99

10-
### `get_fastmcp_metadata` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L26" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
10+
### `get_fastmcp_metadata` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L22" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
1111

1212
```python
1313
get_fastmcp_metadata(meta: dict[str, Any] | None) -> FastMCPMeta
@@ -22,9 +22,9 @@ namespace for compatibility with older FastMCP servers.
2222

2323
## Classes
2424

25-
### `FastMCPMeta` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L20" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
25+
### `FastMCPMeta` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L16" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
2626

27-
### `FastMCPComponent` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L74" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
27+
### `FastMCPComponent` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L70" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
2828

2929

3030
Base class for FastMCP tools, prompts, resources, and resource templates.
@@ -114,58 +114,7 @@ copy(self) -> Self
114114
Create a copy of the component.
115115

116116

117-
#### `register_with_docket` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L227" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
118-
119-
```python
120-
register_with_docket(self, docket: Docket) -> None
121-
```
122-
123-
Register this component with docket for background execution.
124-
125-
No-ops if task_config.mode is "forbidden". Subclasses override to
126-
register their callable (self.run, self.read, self.render, or self.fn).
127-
128-
129-
#### `coerce_task_arguments` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L235" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
130-
131-
```python
132-
coerce_task_arguments(self, arguments: dict[str, Any]) -> dict[str, Any]
133-
```
134-
135-
Validate and coerce task arguments before any task state is created.
136-
137-
Called by ``submit_to_docket`` up front, so invalid inputs raise before
138-
the task's Redis metadata and initial status notification exist —
139-
otherwise a coercion failure during queueing would orphan a task the
140-
client has already observed. The base implementation is a no-op;
141-
components that splat arguments into a typed Python callable (e.g.
142-
``FunctionTool``) override this to mirror the synchronous validation
143-
path.
144-
145-
When ``strict`` is set (server-level ``strict_input_validation``),
146-
overrides validate in strict mode so the task path rejects lax
147-
coercions (e.g. the string ``"1"`` into an ``int``) exactly as the
148-
synchronous call path does.
149-
150-
151-
#### `add_to_docket` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L255" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
152-
153-
```python
154-
add_to_docket(self, docket: Docket, *args: Any, **kwargs: Any) -> Execution
155-
```
156-
157-
Schedule this component for background execution via docket.
158-
159-
Subclasses override this to handle their specific calling conventions:
160-
- Tool: add_to_docket(docket, arguments: dict, **kwargs)
161-
- Resource: add_to_docket(docket, **kwargs)
162-
- ResourceTemplate: add_to_docket(docket, params: dict, **kwargs)
163-
- Prompt: add_to_docket(docket, arguments: dict | None, **kwargs)
164-
165-
The **kwargs are passed through to docket.add() (e.g., key=task_key).
166-
167-
168-
#### `get_span_attributes` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L277" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
117+
#### `get_span_attributes` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L227" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
169118

170119
```python
171120
get_span_attributes(self) -> dict[str, Any]

docs/python-sdk/fastmcp-utilities-tasks.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Task configuration primitives for FastMCP components.
1010

1111
## Classes
1212

13-
### `TaskMeta` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L22" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
13+
### `TaskMeta` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L29" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
1414

1515

1616
Metadata for task-augmented execution requests.
@@ -20,7 +20,7 @@ Metadata for task-augmented execution requests.
2020
- `fn_key`: Docket routing key. Auto-derived from component name if None.
2121

2222

23-
### `TaskConfig` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L35" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
23+
### `TaskConfig` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L42" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
2424

2525

2626
Configuration for MCP background task execution.
@@ -34,7 +34,7 @@ Controls how a component handles task-augmented requests:
3434

3535
**Methods:**
3636

37-
#### `from_bool` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L49" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
37+
#### `from_bool` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L56" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
3838

3939
```python
4040
from_bool(cls, value: bool) -> TaskConfig
@@ -43,7 +43,7 @@ from_bool(cls, value: bool) -> TaskConfig
4343
Convert a boolean task flag to a TaskConfig.
4444

4545

46-
#### `supports_tasks` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L53" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
46+
#### `supports_tasks` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L60" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
4747

4848
```python
4949
supports_tasks(self) -> bool
@@ -52,7 +52,7 @@ supports_tasks(self) -> bool
5252
Check if this component supports task execution.
5353

5454

55-
#### `validate_function` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L57" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
55+
#### `validate_function` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/tasks.py#L64" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
5656

5757
```python
5858
validate_function(self, fn: Callable[..., Any], name: str) -> None

0 commit comments

Comments
 (0)