π The fast, Pythonic way to build MCP servers and clients.
Update documentation
Jeremiah Lowin160d50e3a571
diff --git a/docs/servers/middleware.mdx b/docs/servers/middleware.mdxindex 3251a5bea..ecaa07737 100644--- a/docs/servers/middleware.mdx+++ b/docs/servers/middleware.mdx@@ -111,9 +111,9 @@ FastMCP middleware handles two types of operations differently:**Listing Operations** (`on_list_tools`, `on_list_resources`, `on_list_prompts`, etc.):- Middleware receives **FastMCP component objects** with full metadata-- These objects include FastMCP-specific properties like `tags` that aren't part of the MCP specification-- The result contains complete component information before it's converted to MCP format-- Tags and other metadata are stripped when finally returned to the MCP client+- These objects include FastMCP-specific properties like `tags` that can be accessed directly from the component+- The result contains complete component information before it's converted to MCP format+- Tags are included in the component's `meta` field in the listing response returned to MCP clients**Execution Operations** (`on_call_tool`, `on_read_resource`, `on_get_prompt`):- Middleware runs **before** the component is executed@@ -200,7 +200,7 @@ class ListingFilterMiddleware(Middleware):return filtered_tools```-This filtering happens before the components are converted to MCP format and returned to the client, so the tags (which are FastMCP-specific) are naturally stripped in the final response.+This filtering happens before the components are converted to MCP format and returned to the client. Tags are accessible both during filtering and are included in the component's `meta` field in the final listing response.<Tip>When filtering components in listing operations, ensure you also prevent execution of filtered components in the corresponding execution hooks (`on_call_tool`, `on_read_resource`, `on_get_prompt`) to maintain consistency.diff --git a/docs/servers/prompts.mdx b/docs/servers/prompts.mdxindex d726088e3..814cc2490 100644--- a/docs/servers/prompts.mdx+++ b/docs/servers/prompts.mdx@@ -85,7 +85,7 @@ def data_analysis_prompt(</ParamField><ParamField body="tags" type="set[str] | None">- A set of strings used to categorize the prompt. Clients might use tags to filter or group available prompts+ A set of strings used to categorize the prompt. Clients might use tags to filter or group available prompts. Tags are available to clients in the prompt's `meta` field when the prompt is listed (via `list_prompts`)</ParamField><ParamField body="enabled" type="bool" default="True">diff --git a/docs/servers/resources.mdx b/docs/servers/resources.mdxindex c9b9c96b3..031dd1b79 100644--- a/docs/servers/resources.mdx+++ b/docs/servers/resources.mdx@@ -98,7 +98,7 @@ def get_application_status() -> dict:</ParamField><ParamField body="tags" type="set[str] | None">- A set of strings for categorization, potentially used by clients for filtering+ A set of strings for categorization, potentially used by clients for filtering. Tags are available to clients in the resource's `meta` field when the resource is listed (via `list_resources` or `list_resource_templates`)</ParamField><ParamField body="enabled" type="bool" default="True">diff --git a/docs/servers/tools.mdx b/docs/servers/tools.mdxindex 61d70521c..9baeaadee 100644--- a/docs/servers/tools.mdx+++ b/docs/servers/tools.mdx@@ -76,7 +76,7 @@ def search_products_implementation(query: str, category: str | None = None) -> l</ParamField><ParamField body="tags" type="set[str] | None">- A set of strings to categorize the tool. Clients might use tags to filter or group available tools+ A set of strings to categorize the tool. Clients might use tags to filter or group available tools. Tags are available to clients in the tool's `meta` field when the tool is listed (via `list_tools`)</ParamField><ParamField body="enabled" type="bool" default="True">