You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tool.from_tool: a transform_fn that declares ctx: Context fails on every call #5368
A transform_fn never gets its injected parameters resolved. They are stripped from the schema, and then the call fails. An ordinary tool with the same signature works.
The documented forms fail the same way: ctx: Context = CurrentContext() arrives as the _CurrentContext marker, and k: int = Depends(dep) as _Depends. Only get_context() works inside a transform_fn.
FastMCP main at 9488a26 (source checkout)
MCP version: 2.0.0
Python version: 3.12.3
Platform: Linux-7.0.0-1013-aws-x86_64-with-glibc2.39
@zzstoatzz, should Tool.from_tool resolve these for a transform_fn the way it does for a function tool? cc @jlowin, since the design of tool_transform.py is yours.
Activity
Fix PrefectHQ#5368: Tool.from_tool: a transform_fn that declares ctx:…
fix(deps): update dependency fastmcp to >=4.1,<4.2 (#74)