Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Remove extra copy

Jeremiah Lowin9ddc0c9874f8
diff --git a/src/fastmcp/utilities/json_schema.py b/src/fastmcp/utilities/json_schema.py
index 09ecd6750..87ea4a789 100644
--- a/src/fastmcp/utilities/json_schema.py
+++ b/src/fastmcp/utilities/json_schema.py
@@ -31,8 +31,6 @@ def _walk_and_prune(
prune_additional_properties: bool = False,
) -> dict:
"""Walk the schema and optionally prune titles, unused definitions, and additionalProperties: false."""
- # Deep copy to avoid modifying the original
- schema = copy.deepcopy(schema)
# Will only be used if prune_defs is True
used_defs: set[str] = set()