π The fast, Pythonic way to build MCP servers and clients.
Stop duplicating path parameter descriptions into tool prose (#3149)
Jeremiah Lowin0f95ed72cdec
diff --git a/docs/python-sdk/fastmcp-server-context.mdx b/docs/python-sdk/fastmcp-server-context.mdxindex 2873100b7..a87096234 100644--- a/docs/python-sdk/fastmcp-server-context.mdx+++ b/docs/python-sdk/fastmcp-server-context.mdx@@ -170,6 +170,10 @@ Returns the context dict yielded by the server's lifespan function.Returns an empty dict if no lifespan was configured or if the MCPsession is not yet established.+In background tasks (Docket workers), where request_context is not+available, falls back to reading from the FastMCP server's lifespan+result directly.+Example:```python@server.tool@@ -181,7 +185,7 @@ def my_tool(ctx: Context) -> str:```-#### `report_progress` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L336" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `report_progress` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L345" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonreport_progress(self, progress: float, total: float | None = None, message: str | None = None) -> None@@ -198,7 +202,7 @@ Works in both foreground (MCP progress notifications) and background- `message`: Optional status message describing current progress-#### `list_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L426" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L435" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_resources(self) -> list[SDKResource]@@ -210,7 +214,7 @@ List all available resources from the server.- List of Resource objects available on the server-#### `list_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L442" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L451" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_prompts(self) -> list[SDKPrompt]@@ -222,7 +226,7 @@ List all available prompts from the server.- List of Prompt objects available on the server-#### `get_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L458" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L467" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_prompt(self, name: str, arguments: dict[str, Any] | None = None) -> GetPromptResult@@ -238,7 +242,7 @@ Get a prompt by name with optional arguments.- The prompt result-#### `read_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L477" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `read_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L486" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonread_resource(self, uri: str | AnyUrl) -> ResourceResult@@ -253,7 +257,7 @@ Read a resource by URI.- ResourceResult with contents-#### `log` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L493" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `log` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L502" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlog(self, message: str, level: LoggingLevel | None = None, logger_name: str | None = None, extra: Mapping[str, Any] | None = None) -> None@@ -271,7 +275,7 @@ Messages sent to Clients are also logged to the `fastmcp.server.context.to_clien- `extra`: Optional mapping for additional arguments-#### `transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L522" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L531" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythontransport(self) -> TransportType | None@@ -283,7 +287,7 @@ Returns the transport type used to run this server: "stdio", "sse",or "streamable-http". Returns None if called outside of a server context.-#### `client_supports_extension` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L530" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `client_supports_extension` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L539" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclient_supports_extension(self, extension_id: str) -> bool@@ -308,7 +312,7 @@ Example::return "text-only client"-#### `client_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L558" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `client_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L567" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclient_id(self) -> str | None@@ -317,7 +321,7 @@ client_id(self) -> str | NoneGet the client ID if available.-#### `request_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L567" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `request_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L576" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrequest_id(self) -> str@@ -328,7 +332,7 @@ Get the unique ID for this request.Raises RuntimeError if MCP request context is not available.-#### `session_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L580" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `session_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L589" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsession_id(self) -> str@@ -345,7 +349,7 @@ the same client session.- for other transports.-#### `session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L637" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L646" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsession(self) -> ServerSession@@ -359,7 +363,7 @@ In background task mode: Returns the session stored at Context creation.Raises RuntimeError if no session is available.-#### `debug` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L663" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `debug` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L672" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondebug(self, message: str, logger_name: str | None = None, extra: Mapping[str, Any] | None = None) -> None@@ -370,7 +374,7 @@ Send a `DEBUG`-level message to the connected MCP Client.Messages sent to Clients are also logged to the `fastmcp.server.context.to_client` logger with a level of `DEBUG`.-#### `info` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L679" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `info` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L688" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoninfo(self, message: str, logger_name: str | None = None, extra: Mapping[str, Any] | None = None) -> None@@ -381,7 +385,7 @@ Send a `INFO`-level message to the connected MCP Client.Messages sent to Clients are also logged to the `fastmcp.server.context.to_client` logger with a level of `DEBUG`.-#### `warning` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L695" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `warning` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L704" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonwarning(self, message: str, logger_name: str | None = None, extra: Mapping[str, Any] | None = None) -> None@@ -392,7 +396,7 @@ Send a `WARNING`-level message to the connected MCP Client.Messages sent to Clients are also logged to the `fastmcp.server.context.to_client` logger with a level of `DEBUG`.-#### `error` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L711" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `error` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L720" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonerror(self, message: str, logger_name: str | None = None, extra: Mapping[str, Any] | None = None) -> None@@ -403,7 +407,7 @@ Send a `ERROR`-level message to the connected MCP Client.Messages sent to Clients are also logged to the `fastmcp.server.context.to_client` logger with a level of `DEBUG`.-#### `list_roots` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L727" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_roots` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L736" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_roots(self) -> list[Root]@@ -412,7 +416,7 @@ list_roots(self) -> list[Root]List the roots available to the server, as indicated by the client.-#### `send_notification` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L732" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `send_notification` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L741" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsend_notification(self, notification: mcp.types.ServerNotificationType) -> None@@ -424,7 +428,7 @@ Send a notification to the client immediately.- `notification`: An MCP notification instance (e.g., ToolListChangedNotification())-#### `close_sse_stream` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L742" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `close_sse_stream` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L751" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclose_sse_stream(self) -> None@@ -442,7 +446,7 @@ Instead of holding a connection open for minutes, you can periodically closeand let the client reconnect.-#### `sample_step` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L781" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `sample_step` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L790" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsample_step(self, messages: str | Sequence[str | SamplingMessage]) -> SampleStep@@ -485,7 +489,7 @@ regardless of this setting.- - .text: The text content (if any)-#### `sample` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L860" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `sample` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L869" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsample(self, messages: str | Sequence[str | SamplingMessage]) -> SamplingResult[ResultT]@@ -494,7 +498,7 @@ sample(self, messages: str | Sequence[str | SamplingMessage]) -> SamplingResult[Overload: With result_type, returns SamplingResult[ResultT].-#### `sample` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L876" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `sample` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L885" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsample(self, messages: str | Sequence[str | SamplingMessage]) -> SamplingResult[str]@@ -503,7 +507,7 @@ sample(self, messages: str | Sequence[str | SamplingMessage]) -> SamplingResult[Overload: Without result_type, returns SamplingResult[str].-#### `sample` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L891" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `sample` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L900" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsample(self, messages: str | Sequence[str | SamplingMessage]) -> SamplingResult[ResultT] | SamplingResult[str]@@ -551,43 +555,43 @@ regardless of this setting.- - .history: All messages exchanged during sampling-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L966" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L975" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: None) -> AcceptedElicitation[dict[str, Any]] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L978" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L987" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: type[T]) -> AcceptedElicitation[T] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L988" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L997" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: list[str]) -> AcceptedElicitation[str] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L998" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1007" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: dict[str, dict[str, str]]) -> AcceptedElicitation[str] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1008" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1017" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: list[list[str]]) -> AcceptedElicitation[list[str]] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1020" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1029" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: list[dict[str, dict[str, str]]]) -> AcceptedElicitation[list[str]] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1032" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1041" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: type[T] | list[str] | dict[str, dict[str, str]] | list[list[str]] | list[dict[str, dict[str, str]]] | None = None) -> AcceptedElicitation[T] | AcceptedElicitation[dict[str, Any]] | AcceptedElicitation[str] | AcceptedElicitation[list[str]] | DeclinedElicitation | CancelledElicitation@@ -616,7 +620,7 @@ type or dataclass or BaseModel. If it is a primitive type, anobject schema with a single "value" field will be generated.-#### `set_state` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1146" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `set_state` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1155" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonset_state(self, key: str, value: Any) -> None@@ -629,7 +633,7 @@ The key is automatically prefixed with the session identifier.State expires after 1 day to prevent unbounded memory growth.-#### `get_state` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1160" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_state` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1169" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_state(self, key: str) -> Any@@ -640,7 +644,7 @@ Get a value from the session-scoped state store.Returns None if the key is not found.-#### `delete_state` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1169" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `delete_state` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1178" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondelete_state(self, key: str) -> None@@ -649,7 +653,7 @@ delete_state(self, key: str) -> NoneDelete a value from the session-scoped state store.-#### `enable_components` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1186" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `enable_components` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1195" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonenable_components(self) -> None@@ -673,7 +677,7 @@ ResourceListChangedNotification, and PromptListChangedNotification.- `match_all`: If True, matches all components regardless of other criteria.-#### `disable_components` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1224" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `disable_components` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1233" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondisable_components(self) -> None@@ -697,7 +701,7 @@ ResourceListChangedNotification, and PromptListChangedNotification.- `match_all`: If True, matches all components regardless of other criteria.-#### `reset_visibility` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1262" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `reset_visibility` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L1271" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonreset_visibility(self) -> Nonediff --git a/docs/python-sdk/fastmcp-server-dependencies.mdx b/docs/python-sdk/fastmcp-server-dependencies.mdxindex 496a19e8c..5660ac13a 100644--- a/docs/python-sdk/fastmcp-server-dependencies.mdx+++ b/docs/python-sdk/fastmcp-server-dependencies.mdx@@ -15,7 +15,7 @@ CurrentWorker) and background task execution require fastmcp[tasks].## Functions-### `get_task_context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L91" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `get_task_context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L95" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_task_context() -> TaskContextInfo | None@@ -31,7 +31,7 @@ Returns None if not running in a task context (e.g., foreground execution).- TaskContextInfo with task_id and session_id, or None if not in a task.-### `register_task_session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L129" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `register_task_session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonregister_task_session(session_id: str, session: ServerSession) -> None@@ -49,7 +49,7 @@ client disconnects.- `session`: The ServerSession instance-### `get_task_session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L143" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `get_task_session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L147" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_task_session(session_id: str) -> ServerSession | None@@ -65,7 +65,7 @@ Get a registered session by ID if still alive.- The ServerSession if found and alive, None otherwise-### `is_docket_available` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L176" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `is_docket_available` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L183" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonis_docket_available() -> bool@@ -75,7 +75,7 @@ is_docket_available() -> boolCheck if pydocket is installed.-### `require_docket` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L189" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `require_docket` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L196" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrequire_docket(feature: str) -> None@@ -89,7 +89,7 @@ Raise ImportError with install instructions if docket not available."CurrentDocket()"). Will be included in the error message.-### `transform_context_annotations` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L231" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `transform_context_annotations` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L238" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythontransform_context_annotations(fn: Callable[..., Any]) -> Callable[..., Any]@@ -115,7 +115,7 @@ allows them to have defaults in any order.- Function with modified signature (same function object, updated __signature__)-### `get_context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L382" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `get_context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L389" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_context() -> Context@@ -125,7 +125,7 @@ get_context() -> ContextGet the current FastMCP Context instance directly.-### `get_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L392" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `get_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L399" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_server() -> FastMCP@@ -141,7 +141,7 @@ Get the current FastMCP server instance directly.- `RuntimeError`: If no server in context-### `get_http_request` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L410" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `get_http_request` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L417" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_http_request() -> Request@@ -153,7 +153,7 @@ Get the current HTTP request.Tries MCP SDK's request_ctx first, then falls back to FastMCP's HTTP context.-### `get_http_headers` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L430" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `get_http_headers` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L437" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_http_headers(include_all: bool = False) -> dict[str, str]@@ -169,7 +169,7 @@ By default, strips problematic headers like `content-length` that cause issuesif forwarded to downstream clients. If `include_all` is True, all headers are returned.-### `get_access_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L476" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `get_access_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L483" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_access_token() -> AccessToken | None@@ -181,13 +181,14 @@ Get the FastMCP access token from the current context.This function first tries to get the token from the current HTTP request's scope,which is more reliable for long-lived connections where the SDK's auth_context_varmay become stale after token refresh. Falls back to the SDK's context var if no-request is available.+request is available. In background tasks (Docket workers), falls back to the+token snapshot stored in Redis at task submission time.**Returns:**- The access token if an authenticated user is available, None otherwise.-### `without_injected_parameters` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L534" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `without_injected_parameters` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L555" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonwithout_injected_parameters(fn: Callable[..., Any]) -> Callable[..., Any]@@ -212,7 +213,7 @@ Handles:- Async wrapper function without injected parameters-### `resolve_dependencies` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L675" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `resolve_dependencies` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L696" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonresolve_dependencies(fn: Callable[..., Any], arguments: dict[str, Any]) -> AsyncGenerator[dict[str, Any], None]@@ -238,7 +239,7 @@ time, so all injection goes through the unified DI system.which will be filtered out)-### `CurrentContext` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L771" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `CurrentContext` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L837" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonCurrentContext() -> Context@@ -257,7 +258,7 @@ current MCP operation (tool/resource/prompt call).- `RuntimeError`: If no active context found (during resolution)-### `CurrentDocket` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L814" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `CurrentDocket` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L880" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonCurrentDocket() -> Docket@@ -277,7 +278,7 @@ automatically creates for background task scheduling.- `ImportError`: If fastmcp[tasks] not installed-### `CurrentWorker` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L859" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `CurrentWorker` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L925" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonCurrentWorker() -> Worker@@ -297,7 +298,7 @@ automatically creates for background task processing.- `ImportError`: If fastmcp[tasks] not installed-### `CurrentFastMCP` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L901" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `CurrentFastMCP` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L967" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonCurrentFastMCP() -> FastMCP@@ -315,7 +316,7 @@ This dependency provides access to the active FastMCP server.- `RuntimeError`: If no server in context (during resolution)-### `CurrentRequest` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L936" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `CurrentRequest` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1002" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonCurrentRequest() -> Request@@ -335,7 +336,7 @@ current HTTP request. Only available when running over HTTP transports- `RuntimeError`: If no HTTP request in context (e.g., STDIO transport)-### `CurrentHeaders` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L972" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `CurrentHeaders` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1038" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonCurrentHeaders() -> dict[str, str]@@ -352,7 +353,7 @@ safe to use in code that might run over any transport.- A dependency that resolves to a dictionary of header name -> value-### `CurrentAccessToken` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1146" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `CurrentAccessToken` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1228" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonCurrentAccessToken() -> AccessToken@@ -371,7 +372,7 @@ authenticated request. Raises an error if no authentication is present.- `RuntimeError`: If no authenticated user (use get_access_token() for optional)-### `TokenClaim` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1198" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `TokenClaim` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1280" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonTokenClaim(name: str) -> str@@ -396,7 +397,7 @@ without needing the full token object.## Classes-### `TaskContextInfo` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L77" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `TaskContextInfo` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L81" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Information about the current background task context.@@ -405,7 +406,7 @@ Returned by ``get_task_context()`` when running inside a Docket worker.Contains identifiers needed to communicate with the MCP session.-### `ProgressLike` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L999" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProgressLike` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1065" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Protocol for progress tracking interface.@@ -416,7 +417,7 @@ and Docket's Progress (worker context).**Methods:**-#### `current` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1007" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `current` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1073" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncurrent(self) -> int | None@@ -425,7 +426,7 @@ current(self) -> int | NoneCurrent progress value.-#### `total` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1012" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `total` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1078" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythontotal(self) -> int@@ -434,7 +435,7 @@ total(self) -> intTotal/target progress value.-#### `message` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1017" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `message` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1083" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonmessage(self) -> str | None@@ -443,7 +444,7 @@ message(self) -> str | NoneCurrent progress message.-#### `set_total` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1021" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `set_total` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1087" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonset_total(self, total: int) -> None@@ -452,7 +453,7 @@ set_total(self, total: int) -> NoneSet the total/target value for progress tracking.-#### `increment` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1025" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `increment` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1091" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonincrement(self, amount: int = 1) -> None@@ -461,7 +462,7 @@ increment(self, amount: int = 1) -> NoneAtomically increment the current progress value.-#### `set_message` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1029" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `set_message` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1095" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonset_message(self, message: str | None) -> None@@ -470,7 +471,7 @@ set_message(self, message: str | None) -> NoneUpdate the progress status message.-### `InMemoryProgress` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1034" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `InMemoryProgress` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1100" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>In-memory progress tracker for immediate tool execution.@@ -482,25 +483,25 @@ progress doesn't need to be observable across processes.**Methods:**-#### `current` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1054" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `current` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1120" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncurrent(self) -> int | None```-#### `total` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1058" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `total` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1124" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythontotal(self) -> int```-#### `message` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1062" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `message` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1128" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonmessage(self) -> str | None```-#### `set_total` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1065" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `set_total` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1131" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonset_total(self, total: int) -> None@@ -509,7 +510,7 @@ set_total(self, total: int) -> NoneSet the total/target value for progress tracking.-#### `increment` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1071" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `increment` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1137" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonincrement(self, amount: int = 1) -> None@@ -518,7 +519,7 @@ increment(self, amount: int = 1) -> NoneAtomically increment the current progress value.-#### `set_message` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1080" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `set_message` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1146" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonset_message(self, message: str | None) -> None@@ -527,7 +528,7 @@ set_message(self, message: str | None) -> NoneUpdate the progress status message.-### `Progress` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1085" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `Progress` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/dependencies.py#L1151" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>FastMCP Progress dependency that works in both server and worker contexts.diff --git a/docs/python-sdk/fastmcp-server-providers-openapi-provider.mdx b/docs/python-sdk/fastmcp-server-providers-openapi-provider.mdxindex 69c2b0dae..ba3d7918b 100644--- a/docs/python-sdk/fastmcp-server-providers-openapi-provider.mdx+++ b/docs/python-sdk/fastmcp-server-providers-openapi-provider.mdx@@ -10,7 +10,7 @@ OpenAPIProvider for creating MCP components from OpenAPI specifications.## Classes-### `OpenAPIProvider` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/providers/openapi/provider.py#L52" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `OpenAPIProvider` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/providers/openapi/provider.py#L51" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Provider that creates MCP components from an OpenAPI specification.@@ -21,7 +21,7 @@ spec. Each component makes HTTP calls to the described API endpoints.**Methods:**-#### `lifespan` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/providers/openapi/provider.py#L182" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `lifespan` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/providers/openapi/provider.py#L181" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlifespan(self) -> AsyncIterator[None]@@ -30,7 +30,7 @@ lifespan(self) -> AsyncIterator[None]Manage the lifecycle of the auto-created httpx client.-#### `get_tasks` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/providers/openapi/provider.py#L447" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_tasks` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/providers/openapi/provider.py#L431" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_tasks(self) -> Sequence[FastMCPComponent]diff --git a/docs/python-sdk/fastmcp-utilities-openapi-formatters.mdx b/docs/python-sdk/fastmcp-utilities-openapi-formatters.mdxindex 1b725fc5a..0b9d12369 100644--- a/docs/python-sdk/fastmcp-utilities-openapi-formatters.mdx+++ b/docs/python-sdk/fastmcp-utilities-openapi-formatters.mdx@@ -72,26 +72,7 @@ format_json_for_description(data: Any, indent: int = 2) -> strFormats Python data as a JSON string block for Markdown.-### `format_simple_description` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi/formatters.py#L192" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>--```python-format_simple_description(base_description: str, parameters: list[ParameterInfo] | None = None, request_body: RequestBodyInfo | None = None) -> str-```---Formats a simple description for MCP objects (tools, resources, prompts).-Excludes response details, examples, and verbose status codes.--**Args:**-- `base_description`: The initial description to be formatted.-- `parameters`: A list of parameter information.-- `request_body`: Information about the request body.--**Returns:**-- The formatted description string with minimal details.---### `format_description_with_responses` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi/formatters.py#L225" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `format_description_with_responses` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi/formatters.py#L192" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonformat_description_with_responses(base_description: str, responses: dict[str, Any], parameters: list[ParameterInfo] | None = None, request_body: RequestBodyInfo | None = None) -> strdiff --git a/src/fastmcp/experimental/utilities/openapi/__init__.py b/src/fastmcp/experimental/utilities/openapi/__init__.pyindex 51c947bf1..0c8dd15e5 100644--- a/src/fastmcp/experimental/utilities/openapi/__init__.py+++ b/src/fastmcp/experimental/utilities/openapi/__init__.py@@ -10,7 +10,6 @@ from fastmcp.utilities.openapi import (RequestBodyInfo,ResponseInfo,extract_output_schema_from_responses,- format_simple_description,parse_openapi_to_http_routes,_combine_schemas,)@@ -32,6 +31,5 @@ __all__ = ["ResponseInfo","_combine_schemas","extract_output_schema_from_responses",- "format_simple_description","parse_openapi_to_http_routes",]diff --git a/src/fastmcp/server/providers/openapi/provider.py b/src/fastmcp/server/providers/openapi/provider.pyindex 68979c0c1..975e0228b 100644--- a/src/fastmcp/server/providers/openapi/provider.py+++ b/src/fastmcp/server/providers/openapi/provider.py@@ -34,7 +34,6 @@ from fastmcp.utilities.logging import get_loggerfrom fastmcp.utilities.openapi import (HTTPRoute,extract_output_schema_from_responses,- format_simple_description,parse_openapi_to_http_routes,)from fastmcp.utilities.openapi.director import RequestDirector@@ -255,18 +254,13 @@ class OpenAPIProvider(Provider):or route.summaryor f"Executes {route.method} {route.path}")- enhanced_description = format_simple_description(- base_description=base_description,- parameters=route.parameters,- request_body=route.request_body,- )tool = OpenAPITool(client=self._client,route=route,director=self._director,name=tool_name,- description=enhanced_description,+ description=base_description,parameters=combined_schema,output_schema=output_schema,tags=set(route.tags or []) | tags,@@ -293,11 +287,6 @@ class OpenAPIProvider(Provider):base_description = (route.description or route.summary or f"Represents {route.path}")- enhanced_description = format_simple_description(- base_description=base_description,- parameters=route.parameters,- request_body=route.request_body,- )resource = OpenAPIResource(client=self._client,@@ -305,7 +294,7 @@ class OpenAPIProvider(Provider):director=self._director,uri=resource_uri,name=resource_name,- description=enhanced_description,+ description=base_description,mime_type=_extract_mime_type_from_route(route),tags=set(route.tags or []) | tags,)@@ -338,11 +327,6 @@ class OpenAPIProvider(Provider):base_description = (route.description or route.summary or f"Template for {route.path}")- enhanced_description = format_simple_description(- base_description=base_description,- parameters=route.parameters,- request_body=route.request_body,- )template_params_schema = {"type": "object",@@ -372,7 +356,7 @@ class OpenAPIProvider(Provider):director=self._director,uri_template=uri_template_str,name=template_name,- description=enhanced_description,+ description=base_description,parameters=template_params_schema,tags=set(route.tags or []) | tags,mime_type=_extract_mime_type_from_route(route),diff --git a/src/fastmcp/utilities/openapi/__init__.py b/src/fastmcp/utilities/openapi/__init__.pyindex f71bc7a6a..eb25666d1 100644--- a/src/fastmcp/utilities/openapi/__init__.py+++ b/src/fastmcp/utilities/openapi/__init__.py@@ -20,7 +20,6 @@ from .formatters import (format_deep_object_parameter,format_description_with_responses,format_json_for_description,- format_simple_description,generate_example_from_schema,)@@ -57,7 +56,6 @@ __all__ = ["format_deep_object_parameter","format_description_with_responses","format_json_for_description",- "format_simple_description","generate_example_from_schema","parse_openapi_to_http_routes",]diff --git a/src/fastmcp/utilities/openapi/formatters.py b/src/fastmcp/utilities/openapi/formatters.pyindex 27580fcdd..a0bd75bef 100644--- a/src/fastmcp/utilities/openapi/formatters.py+++ b/src/fastmcp/utilities/openapi/formatters.py@@ -189,39 +189,6 @@ def format_json_for_description(data: Any, indent: int = 2) -> str:return f"```\nCould not serialize to JSON: {data}\n```"-def format_simple_description(- base_description: str,- parameters: list[ParameterInfo] | None = None,- request_body: RequestBodyInfo | None = None,-) -> str:- """- Formats a simple description for MCP objects (tools, resources, prompts).- Excludes response details, examples, and verbose status codes.-- Args:- base_description (str): The initial description to be formatted.- parameters (list[ParameterInfo] | None, optional): A list of parameter information.- request_body (RequestBodyInfo | None, optional): Information about the request body.-- Returns:- str: The formatted description string with minimal details.- """- desc_parts = [base_description]-- # Only add critical parameter information if they have descriptions- if parameters:- path_params = [p for p in parameters if p.location == "path" and p.description]- if path_params:- desc_parts.append("\n\n**Path Parameters:**")- for param in path_params:- desc_parts.append(f"\n- **{param.name}**: {param.description}")-- # Skip query parameters, request body details, and all response information- # These are already captured in the inputSchema-- return "\n".join(desc_parts)--def format_description_with_responses(base_description: str,responses: dict[@@ -384,6 +351,5 @@ __all__ = ["format_deep_object_parameter","format_description_with_responses","format_json_for_description",- "format_simple_description","generate_example_from_schema",]diff --git a/tests/server/test_tool_transformation.py b/tests/server/test_tool_transformation.pyindex 4f9833bdf..4cf938822 100644--- a/tests/server/test_tool_transformation.py+++ b/tests/server/test_tool_transformation.py@@ -1,6 +1,12 @@+import httpx+from fastmcp import FastMCP+from fastmcp.client import Clientfrom fastmcp.server.transforms import ToolTransform-from fastmcp.tools.tool_transform import ToolTransformConfig+from fastmcp.tools.tool_transform import (+ ArgTransformConfig,+ ToolTransformConfig,+)async def test_tool_transformation_via_layer():@@ -207,3 +213,73 @@ async def test_tool_transform_config_enabled_true_overrides_earlier_disable():# Tool should now be visibleassert "my_tool" in tool_names+++async def test_openapi_path_params_not_duplicated_in_description():+ """Path parameter details should live in inputSchema, not the description.++ Regression test for https://github.com/jlowin/fastmcp/issues/3130 β hiding+ a path param via ToolTransform left stale references in the description+ because the description was generated before transforms ran. The fix is to+ keep parameter docs in inputSchema only, where transforms can control them.+ """+ spec = {+ "openapi": "3.1.0",+ "info": {"title": "Test", "version": "0.1.0"},+ "paths": {+ "/api/{version}/users/{user_id}": {+ "get": {+ "operationId": "my_endpoint",+ "summary": "My endpoint",+ "parameters": [+ {+ "name": "version",+ "in": "path",+ "required": True,+ "description": "API version",+ "schema": {"type": "string"},+ },+ {+ "name": "user_id",+ "in": "path",+ "required": True,+ "description": "The user ID",+ "schema": {"type": "string"},+ },+ ],+ "responses": {"200": {"description": "OK"}},+ },+ },+ },+ }++ async with httpx.AsyncClient(base_url="http://localhost") as http_client:+ mcp = FastMCP.from_openapi(openapi_spec=spec, client=http_client)++ # Hide one of the two path params+ mcp.add_transform(+ ToolTransform(+ {+ "my_endpoint": ToolTransformConfig(+ arguments={+ "version": ArgTransformConfig(hide=True, default="v1"),+ }+ )+ }+ )+ )++ async with Client(mcp) as client:+ tools = await client.list_tools()+ tool = tools[0]++ # Description should be the summary only β no parameter details+ assert tool.description == "My endpoint"++ # Hidden param gone from schema, visible param still present+ assert "version" not in tool.inputSchema.get("properties", {})+ assert "user_id" in tool.inputSchema["properties"]+ assert (+ tool.inputSchema["properties"]["user_id"]["description"]+ == "The user ID"+ )