From 522ed5bb3060f643443d58c349519b8ffdd991b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=8D?= <13774486042@163.com> Date: Mon, 6 Jul 2026 05:44:28 +0800 Subject: [PATCH] fix: correct replace_type docstring parameter descriptions (#4375) --- fastmcp_slim/fastmcp/utilities/types.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fastmcp_slim/fastmcp/utilities/types.py b/fastmcp_slim/fastmcp/utilities/types.py index 9980d7e62..70e778290 100644 --- a/fastmcp_slim/fastmcp/utilities/types.py +++ b/fastmcp_slim/fastmcp/utilities/types.py @@ -454,14 +454,13 @@ class File: def replace_type(type_, type_map: dict[type, type]): """ Given a (possibly generic, nested, or otherwise complex) type, replaces all - instances of old_type with new_type. + instances of keys in type_map with their corresponding values. This is useful for transforming types when creating tools. Args: - type_: The type to replace instances of old_type with new_type. - old_type: The type to replace. - new_type: The type to replace old_type with. + type_: The type to transform. + type_map: A mapping of types to replace (keys are replaced by values). Examples: ```python