From 37fb0ad803a528950ddead95a60176712d260965 Mon Sep 17 00:00:00 2001 From: "marvin-context-protocol[bot]" <225465937+marvin-context-protocol[bot]@users.noreply.github.com> Date: Thu, 23 Jul 2026 20:52:17 -0400 Subject: [PATCH] chore: Update SDK documentation (#4615) --- docs/python-sdk/fastmcp-dependencies.mdx | 5 +- docs/python-sdk/fastmcp-settings.mdx | 14 ++--- .../fastmcp-utilities-components.mdx | 59 ++----------------- docs/python-sdk/fastmcp-utilities-tasks.mdx | 10 ++-- 4 files changed, 16 insertions(+), 72 deletions(-) diff --git a/docs/python-sdk/fastmcp-dependencies.mdx b/docs/python-sdk/fastmcp-dependencies.mdx index f27566ef3..310511e56 100644 --- a/docs/python-sdk/fastmcp-dependencies.mdx +++ b/docs/python-sdk/fastmcp-dependencies.mdx @@ -12,6 +12,7 @@ This module re-exports dependency injection symbols to provide a clean, centralized import location for all dependency-related functionality. DI features (Depends, CurrentContext, CurrentFastMCP) work without pydocket -using the uncalled-for DI engine. Only task-related dependencies (CurrentDocket, -CurrentWorker) and background task execution require fastmcp[tasks]. +using the uncalled-for DI engine. The docket-specific dependencies +(``CurrentDocket``, ``CurrentWorker``) live in the ``fastmcp-tasks`` package +(``fastmcp_tasks.dependencies``). diff --git a/docs/python-sdk/fastmcp-settings.mdx b/docs/python-sdk/fastmcp-settings.mdx index 87940be01..b6f401939 100644 --- a/docs/python-sdk/fastmcp-settings.mdx +++ b/docs/python-sdk/fastmcp-settings.mdx @@ -7,13 +7,7 @@ sidebarTitle: settings ## Classes -### `DocketSettings` - - -Docket worker configuration. - - -### `Settings` +### `Settings` FastMCP settings. @@ -21,7 +15,7 @@ FastMCP settings. **Methods:** -#### `get_setting` +#### `get_setting` ```python get_setting(self, attr: str) -> Any @@ -31,7 +25,7 @@ Get a setting. If the setting contains one or more `__`, it will be treated as a nested setting. -#### `set_setting` +#### `set_setting` ```python 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 treated as a nested setting. -#### `normalize_log_level` +#### `normalize_log_level` ```python normalize_log_level(cls, v) diff --git a/docs/python-sdk/fastmcp-utilities-components.mdx b/docs/python-sdk/fastmcp-utilities-components.mdx index 61462e665..eb71e0a88 100644 --- a/docs/python-sdk/fastmcp-utilities-components.mdx +++ b/docs/python-sdk/fastmcp-utilities-components.mdx @@ -7,7 +7,7 @@ sidebarTitle: components ## Functions -### `get_fastmcp_metadata` +### `get_fastmcp_metadata` ```python get_fastmcp_metadata(meta: dict[str, Any] | None) -> FastMCPMeta @@ -22,9 +22,9 @@ namespace for compatibility with older FastMCP servers. ## Classes -### `FastMCPMeta` +### `FastMCPMeta` -### `FastMCPComponent` +### `FastMCPComponent` Base class for FastMCP tools, prompts, resources, and resource templates. @@ -114,58 +114,7 @@ copy(self) -> Self Create a copy of the component. -#### `register_with_docket` - -```python -register_with_docket(self, docket: Docket) -> None -``` - -Register this component with docket for background execution. - -No-ops if task_config.mode is "forbidden". Subclasses override to -register their callable (self.run, self.read, self.render, or self.fn). - - -#### `coerce_task_arguments` - -```python -coerce_task_arguments(self, arguments: dict[str, Any]) -> dict[str, Any] -``` - -Validate and coerce task arguments before any task state is created. - -Called by ``submit_to_docket`` up front, so invalid inputs raise before -the task's Redis metadata and initial status notification exist — -otherwise a coercion failure during queueing would orphan a task the -client has already observed. The base implementation is a no-op; -components that splat arguments into a typed Python callable (e.g. -``FunctionTool``) override this to mirror the synchronous validation -path. - -When ``strict`` is set (server-level ``strict_input_validation``), -overrides validate in strict mode so the task path rejects lax -coercions (e.g. the string ``"1"`` into an ``int``) exactly as the -synchronous call path does. - - -#### `add_to_docket` - -```python -add_to_docket(self, docket: Docket, *args: Any, **kwargs: Any) -> Execution -``` - -Schedule this component for background execution via docket. - -Subclasses override this to handle their specific calling conventions: -- Tool: add_to_docket(docket, arguments: dict, **kwargs) -- Resource: add_to_docket(docket, **kwargs) -- ResourceTemplate: add_to_docket(docket, params: dict, **kwargs) -- Prompt: add_to_docket(docket, arguments: dict | None, **kwargs) - -The **kwargs are passed through to docket.add() (e.g., key=task_key). - - -#### `get_span_attributes` +#### `get_span_attributes` ```python get_span_attributes(self) -> dict[str, Any] diff --git a/docs/python-sdk/fastmcp-utilities-tasks.mdx b/docs/python-sdk/fastmcp-utilities-tasks.mdx index ed455626e..7a520bb04 100644 --- a/docs/python-sdk/fastmcp-utilities-tasks.mdx +++ b/docs/python-sdk/fastmcp-utilities-tasks.mdx @@ -10,7 +10,7 @@ Task configuration primitives for FastMCP components. ## Classes -### `TaskMeta` +### `TaskMeta` Metadata for task-augmented execution requests. @@ -20,7 +20,7 @@ Metadata for task-augmented execution requests. - `fn_key`: Docket routing key. Auto-derived from component name if None. -### `TaskConfig` +### `TaskConfig` Configuration for MCP background task execution. @@ -34,7 +34,7 @@ Controls how a component handles task-augmented requests: **Methods:** -#### `from_bool` +#### `from_bool` ```python from_bool(cls, value: bool) -> TaskConfig @@ -43,7 +43,7 @@ from_bool(cls, value: bool) -> TaskConfig Convert a boolean task flag to a TaskConfig. -#### `supports_tasks` +#### `supports_tasks` ```python supports_tasks(self) -> bool @@ -52,7 +52,7 @@ supports_tasks(self) -> bool Check if this component supports task execution. -#### `validate_function` +#### `validate_function` ```python validate_function(self, fn: Callable[..., Any], name: str) -> None