Skip to content

Commit c984fbf

Browse files
authored
Fix : strings parameters in tool are automatically decoded when call tool
1 parent 959d4e3 commit c984fbf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mcp/server/fastmcp/utilities/func_metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def pre_parse_json(self, data: dict[str, Any]) -> dict[str, Any]:
142142
for data_key in data.keys():
143143
if data_key not in key_to_field_info:
144144
continue
145+
if field_info.annotation is str:
146+
continue # For str parameter - skip
145147

146148
field_info = key_to_field_info[data_key]
147149
if isinstance(data[data_key], str) and field_info.annotation is not str:

0 commit comments

Comments
 (0)