Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
c135727
1
Parent(s): b5feac0
filled_arguments → arguments
Browse files
src/fastmcp/tools/tool_transform.py
CHANGED
|
@@ -273,16 +273,16 @@ class TransformedTool(Tool):
|
|
| 273 |
|
| 274 |
# Fill in missing arguments with schema defaults to ensure
|
| 275 |
# ArgTransform defaults take precedence over function defaults
|
| 276 |
-
|
| 277 |
properties = self.parameters.get("properties", {})
|
| 278 |
|
| 279 |
for param_name, param_schema in properties.items():
|
| 280 |
-
if param_name not in
|
| 281 |
-
|
| 282 |
|
| 283 |
token = _current_tool.set(self)
|
| 284 |
try:
|
| 285 |
-
result = await self.fn(**
|
| 286 |
return _convert_to_content(result, serializer=self.serializer)
|
| 287 |
finally:
|
| 288 |
_current_tool.reset(token)
|
|
|
|
| 273 |
|
| 274 |
# Fill in missing arguments with schema defaults to ensure
|
| 275 |
# ArgTransform defaults take precedence over function defaults
|
| 276 |
+
arguments = arguments.copy()
|
| 277 |
properties = self.parameters.get("properties", {})
|
| 278 |
|
| 279 |
for param_name, param_schema in properties.items():
|
| 280 |
+
if param_name not in arguments and "default" in param_schema:
|
| 281 |
+
arguments[param_name] = param_schema["default"]
|
| 282 |
|
| 283 |
token = _current_tool.set(self)
|
| 284 |
try:
|
| 285 |
+
result = await self.fn(**arguments)
|
| 286 |
return _convert_to_content(result, serializer=self.serializer)
|
| 287 |
finally:
|
| 288 |
_current_tool.reset(token)
|