From 4d5627ba5d796c2107c79b6e51b37c52bb7f2b86 Mon Sep 17 00:00:00 2001 From: "marvin-context-protocol[bot]" <225465937+marvin-context-protocol[bot]@users.noreply.github.com> Date: Sat, 27 Jun 2026 10:36:03 -0400 Subject: [PATCH] chore: Update SDK documentation (#4360) --- docs/python-sdk-pages.json | 16 ------------- docs/python-sdk/fastmcp-client.mdx | 8 ------- .../fastmcp-experimental-__init__.mdx | 8 ------- ...fastmcp-experimental-sampling-__init__.mdx | 8 ------- ...fastmcp-experimental-sampling-handlers.mdx | 8 ------- ...stmcp-experimental-transforms-__init__.mdx | 8 ------- docs/python-sdk/fastmcp-prompts.mdx | 8 ------- docs/python-sdk/fastmcp-resources.mdx | 8 ------- docs/python-sdk/fastmcp-server.mdx | 8 ------- docs/python-sdk/fastmcp-tools.mdx | 8 ------- docs/python-sdk/fastmcp-types.mdx | 18 ++++++++------- .../fastmcp-utilities-components.mdx | 21 +++++++++++++++-- .../fastmcp-utilities-json_schema.mdx | 23 ++++++++++++++++--- ...tilities-mcp_server_config-v1-__init__.mdx | 8 ------- ...-mcp_server_config-v1-sources-__init__.mdx | 8 ------- 15 files changed, 49 insertions(+), 117 deletions(-) delete mode 100644 docs/python-sdk/fastmcp-client.mdx delete mode 100644 docs/python-sdk/fastmcp-experimental-__init__.mdx delete mode 100644 docs/python-sdk/fastmcp-experimental-sampling-__init__.mdx delete mode 100644 docs/python-sdk/fastmcp-experimental-sampling-handlers.mdx delete mode 100644 docs/python-sdk/fastmcp-experimental-transforms-__init__.mdx delete mode 100644 docs/python-sdk/fastmcp-prompts.mdx delete mode 100644 docs/python-sdk/fastmcp-resources.mdx delete mode 100644 docs/python-sdk/fastmcp-server.mdx delete mode 100644 docs/python-sdk/fastmcp-tools.mdx delete mode 100644 docs/python-sdk/fastmcp-utilities-mcp_server_config-v1-__init__.mdx delete mode 100644 docs/python-sdk/fastmcp-utilities-mcp_server_config-v1-sources-__init__.mdx diff --git a/docs/python-sdk-pages.json b/docs/python-sdk-pages.json index 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.mdx deleted file mode 100644 index 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__.mdx deleted file mode 100644 index 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__.mdx deleted file mode 100644 index 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.mdx deleted file mode 100644 index 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__.mdx deleted file mode 100644 index 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.mdx deleted file mode 100644 index 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.mdx deleted file mode 100644 index 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.mdx deleted file mode 100644 index 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.mdx deleted file mode 100644 index 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.mdx index 7aa854d47..1e7df0e90 100644 --- a/docs/python-sdk/fastmcp-types.mdx +++ b/docs/python-sdk/fastmcp-types.mdx @@ -9,17 +9,19 @@ sidebarTitle: types Reusable 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`) and serialized 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: - ... +@mcp.tool() +def run_query(sql: Textarea) -> str: + ... +``` diff --git a/docs/python-sdk/fastmcp-utilities-components.mdx b/docs/python-sdk/fastmcp-utilities-components.mdx index 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 to register their callable (self.run, self.read, self.render, or self.fn). -#### `add_to_docket` +#### `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. + + +#### `add_to_docket` ```python add_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` +#### `get_span_attributes` ```python get_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.mdx index 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` +### `require_discriminator_property` + +```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` ```python dereference_refs(schema: dict[str, Any]) -> dict[str, Any] @@ -40,7 +57,7 @@ schemas from untrusted servers. - when no longer needed -### `resolve_root_ref` +### `resolve_root_ref` ```python resolve_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` +### `compress_schema` ```python compress_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__.mdx deleted file mode 100644 index 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__.mdx deleted file mode 100644 index 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.*