π The fast, Pythonic way to build MCP servers and clients.
chore: Update SDK documentation (#4360)
marvin-context-protocol[bot]4d5627ba5d79
diff --git a/docs/python-sdk-pages.json b/docs/python-sdk-pages.jsonindex b16a3c2ab..6d71d0d53 100644--- a/docs/python-sdk-pages.json+++ b/docs/python-sdk-pages.json@@ -1,16 +1,11 @@["python-sdk/fastmcp-cli",- "python-sdk/fastmcp-client","python-sdk/fastmcp-decorators","python-sdk/fastmcp-dependencies","python-sdk/fastmcp-exceptions","python-sdk/fastmcp-mcp_config",- "python-sdk/fastmcp-prompts",- "python-sdk/fastmcp-resources",- "python-sdk/fastmcp-server","python-sdk/fastmcp-settings","python-sdk/fastmcp-telemetry",- "python-sdk/fastmcp-tools","python-sdk/fastmcp-types",{"group": "fastmcp.apps",@@ -28,18 +23,9 @@{"group": "fastmcp.experimental","pages": [- "python-sdk/fastmcp-experimental-__init__",- {- "group": "sampling",- "pages": [- "python-sdk/fastmcp-experimental-sampling-__init__",- "python-sdk/fastmcp-experimental-sampling-handlers"- ]- },{"group": "transforms","pages": [- "python-sdk/fastmcp-experimental-transforms-__init__","python-sdk/fastmcp-experimental-transforms-code_mode"]}@@ -69,7 +55,6 @@{"group": "v1","pages": [- "python-sdk/fastmcp-utilities-mcp_server_config-v1-__init__",{"group": "environments","pages": [@@ -82,7 +67,6 @@{"group": "sources","pages": [- "python-sdk/fastmcp-utilities-mcp_server_config-v1-sources-__init__","python-sdk/fastmcp-utilities-mcp_server_config-v1-sources-base","python-sdk/fastmcp-utilities-mcp_server_config-v1-sources-filesystem"]diff --git a/docs/python-sdk/fastmcp-client.mdx b/docs/python-sdk/fastmcp-client.mdxdeleted file mode 100644index 5e1b78ef7..000000000--- a/docs/python-sdk/fastmcp-client.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: client-sidebarTitle: client------# `fastmcp.client`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-experimental-__init__.mdx b/docs/python-sdk/fastmcp-experimental-__init__.mdxdeleted file mode 100644index 04ef31f33..000000000--- a/docs/python-sdk/fastmcp-experimental-__init__.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: __init__-sidebarTitle: __init__------# `fastmcp.experimental`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-experimental-sampling-__init__.mdx b/docs/python-sdk/fastmcp-experimental-sampling-__init__.mdxdeleted file mode 100644index f37691267..000000000--- a/docs/python-sdk/fastmcp-experimental-sampling-__init__.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: __init__-sidebarTitle: __init__------# `fastmcp.experimental.sampling`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-experimental-sampling-handlers.mdx b/docs/python-sdk/fastmcp-experimental-sampling-handlers.mdxdeleted file mode 100644index 9220684bb..000000000--- a/docs/python-sdk/fastmcp-experimental-sampling-handlers.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: handlers-sidebarTitle: handlers------# `fastmcp.experimental.sampling.handlers`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-experimental-transforms-__init__.mdx b/docs/python-sdk/fastmcp-experimental-transforms-__init__.mdxdeleted file mode 100644index a33a00679..000000000--- a/docs/python-sdk/fastmcp-experimental-transforms-__init__.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: __init__-sidebarTitle: __init__------# `fastmcp.experimental.transforms`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-prompts.mdx b/docs/python-sdk/fastmcp-prompts.mdxdeleted file mode 100644index c20e366a9..000000000--- a/docs/python-sdk/fastmcp-prompts.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: prompts-sidebarTitle: prompts------# `fastmcp.prompts`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-resources.mdx b/docs/python-sdk/fastmcp-resources.mdxdeleted file mode 100644index b5c8f5a31..000000000--- a/docs/python-sdk/fastmcp-resources.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: resources-sidebarTitle: resources------# `fastmcp.resources`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-server.mdx b/docs/python-sdk/fastmcp-server.mdxdeleted file mode 100644index 589fdadac..000000000--- a/docs/python-sdk/fastmcp-server.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: server-sidebarTitle: server------# `fastmcp.server`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-tools.mdx b/docs/python-sdk/fastmcp-tools.mdxdeleted file mode 100644index f6b72c841..000000000--- a/docs/python-sdk/fastmcp-tools.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: tools-sidebarTitle: tools------# `fastmcp.tools`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-types.mdx b/docs/python-sdk/fastmcp-types.mdxindex 7aa854d47..1e7df0e90 100644--- a/docs/python-sdk/fastmcp-types.mdx+++ b/docs/python-sdk/fastmcp-types.mdx@@ -9,17 +9,19 @@ sidebarTitle: typesReusable type annotations for FastMCP tool parameters.These types can be used in tool function signatures to influence how-parameters are presented in UIs (e.g. ``fastmcp dev apps``) and+parameters are presented in UIs (e.g. `fastmcp dev apps`) andserialized in JSON Schema.-Example::+Example:- from fastmcp import FastMCP- from fastmcp.types import Textarea+```python+from fastmcp import FastMCP+from fastmcp.types import Textarea- mcp = FastMCP("demo")+mcp = FastMCP("demo")- @mcp.tool()- def run_query(sql: Textarea) -> str:- ...+def run_query(sql: Textarea) -> str:+ ...+```diff --git a/docs/python-sdk/fastmcp-utilities-components.mdx b/docs/python-sdk/fastmcp-utilities-components.mdxindex 93bf77f0d..7bb360a63 100644--- a/docs/python-sdk/fastmcp-utilities-components.mdx+++ b/docs/python-sdk/fastmcp-utilities-components.mdx@@ -126,7 +126,24 @@ No-ops if task_config.mode is "forbidden". Subclasses override toregister their callable (self.run, self.read, self.render, or self.fn).-#### `add_to_docket` <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>+#### `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>++```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.+++#### `add_to_docket` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L248" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_to_docket(self, docket: Docket, *args: Any, **kwargs: Any) -> Execution@@ -143,7 +160,7 @@ Subclasses override this to handle their specific calling conventions:The **kwargs are passed through to docket.add() (e.g., key=task_key).-#### `get_span_attributes` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L257" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_span_attributes` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L270" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_span_attributes(self) -> dict[str, Any]diff --git a/docs/python-sdk/fastmcp-utilities-json_schema.mdx b/docs/python-sdk/fastmcp-utilities-json_schema.mdxindex ca24bc283..43e99691d 100644--- a/docs/python-sdk/fastmcp-utilities-json_schema.mdx+++ b/docs/python-sdk/fastmcp-utilities-json_schema.mdx@@ -7,7 +7,24 @@ sidebarTitle: json_schema## Functions-### `dereference_refs` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/json_schema.py#L104" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `require_discriminator_property` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/json_schema.py#L116" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+require_discriminator_property(schema: dict[str, Any]) -> dict[str, Any]+```+++Keep an OpenAPI discriminator's tag mandatory after the keyword is dropped.++Returns a copy of *schema* with ``discriminator.propertyName`` added to each+``anyOf``/``oneOf`` variant's ``required`` list. A Pydantic discriminated+union whose tag has a default omits that tag from ``required``; without this,+an untagged payload passes the generated schema but fails later in the source+model with ``union_tag_not_found``. No-op if there is no string+``propertyName``.+++### `dereference_refs` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/json_schema.py#L147" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondereference_refs(schema: dict[str, Any]) -> dict[str, Any]@@ -40,7 +57,7 @@ schemas from untrusted servers.- when no longer needed-### `resolve_root_ref` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/json_schema.py#L251" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `resolve_root_ref` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/json_schema.py#L294" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonresolve_root_ref(schema: dict[str, Any]) -> dict[str, Any]@@ -62,7 +79,7 @@ the referenced definition while preserving $defs for nested references.- if no resolution is needed-### `compress_schema` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/json_schema.py#L645" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `compress_schema` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/json_schema.py#L688" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncompress_schema(schema: dict[str, Any], prune_params: list[str] | None = None, prune_additional_properties: bool = False, prune_titles: bool = False, dereference: bool = False) -> dict[str, Any]diff --git a/docs/python-sdk/fastmcp-utilities-mcp_server_config-v1-__init__.mdx b/docs/python-sdk/fastmcp-utilities-mcp_server_config-v1-__init__.mdxdeleted file mode 100644index d29664280..000000000--- a/docs/python-sdk/fastmcp-utilities-mcp_server_config-v1-__init__.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: __init__-sidebarTitle: __init__------# `fastmcp.utilities.mcp_server_config.v1`--*This module is empty or contains only private/internal implementations.*diff --git a/docs/python-sdk/fastmcp-utilities-mcp_server_config-v1-sources-__init__.mdx b/docs/python-sdk/fastmcp-utilities-mcp_server_config-v1-sources-__init__.mdxdeleted file mode 100644index 38d102b15..000000000--- a/docs/python-sdk/fastmcp-utilities-mcp_server_config-v1-sources-__init__.mdx+++ /dev/null@@ -1,8 +0,0 @@-----title: __init__-sidebarTitle: __init__------# `fastmcp.utilities.mcp_server_config.v1.sources`--*This module is empty or contains only private/internal implementations.*