From d3f25ab2fd8f0e62c811ef2a37121d132412877b Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 20 Aug 2025 15:42:48 -0400 Subject: [PATCH] Remove "unconditionally" from conditional description The current docstrings regarding tool creation read, "unconditionally creates a structured tool (return type annotation permitting)". If the return type annotation limits whether or not a structured tool can be created, then creation of a structured tool is *conditional* upon the presence of a proper return type annotation. Therefore, these descriptions should not include the word "unconditionally", as it is inaccurate and contradictory. --- src/mcp/server/fastmcp/server.py | 4 ++-- src/mcp/server/fastmcp/utilities/func_metadata.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mcp/server/fastmcp/server.py b/src/mcp/server/fastmcp/server.py index 924baaa9b..093442401 100644 --- a/src/mcp/server/fastmcp/server.py +++ b/src/mcp/server/fastmcp/server.py @@ -360,7 +360,7 @@ def add_tool( annotations: Optional ToolAnnotations providing additional tool information structured_output: Controls whether the tool's output is structured or unstructured - If None, auto-detects based on the function's return type annotation - - If True, unconditionally creates a structured tool (return type annotation permitting) + - If True, creates a structured tool (return type annotation permitting) - If False, unconditionally creates an unstructured tool """ self._tool_manager.add_tool( @@ -393,7 +393,7 @@ def tool( annotations: Optional ToolAnnotations providing additional tool information structured_output: Controls whether the tool's output is structured or unstructured - If None, auto-detects based on the function's return type annotation - - If True, unconditionally creates a structured tool (return type annotation permitting) + - If True, creates a structured tool (return type annotation permitting) - If False, unconditionally creates an unstructured tool Example: diff --git a/src/mcp/server/fastmcp/utilities/func_metadata.py b/src/mcp/server/fastmcp/utilities/func_metadata.py index 70be8796d..3043adc77 100644 --- a/src/mcp/server/fastmcp/utilities/func_metadata.py +++ b/src/mcp/server/fastmcp/utilities/func_metadata.py @@ -187,7 +187,7 @@ def func_metadata( the model. structured_output: Controls whether the tool's output is structured or unstructured - If None, auto-detects based on the function's return type annotation - - If True, unconditionally creates a structured tool (return type annotation permitting) + - If True, creates a structured tool (return type annotation permitting) - If False, unconditionally creates an unstructured tool If structured, creates a Pydantic model for the function's result based on its annotation.