mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-26 15:34:18 +02:00
fix(server): preserve mounted tool task metadata (#3632)
* fix(server): preserve mounted tool task metadata * fix(server): move task execution metadata to base tool * cleanup: remove stale import, tighten execution metadata guard --------- Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
This commit is contained in:
parent
b1505ba5d7
commit
59a126a0b6
4 changed files with 41 additions and 21 deletions
|
|
@ -473,6 +473,35 @@ class TestMountedTaskList:
|
|||
assert child_task.task_id in task_ids
|
||||
|
||||
|
||||
class TestMountedTaskMetadata:
|
||||
"""Test task metadata exposure for mounted tools."""
|
||||
|
||||
async def test_mounted_tool_list_preserves_task_support_metadata(self):
|
||||
"""Mounted tools should preserve execution.taskSupport in tools/list."""
|
||||
child = FastMCP("child")
|
||||
|
||||
@child.tool(task=True)
|
||||
async def foo() -> dict[str, bool]:
|
||||
return {"ok": True}
|
||||
|
||||
parent = FastMCP("parent")
|
||||
parent.mount(child)
|
||||
|
||||
child_tools = await child.list_tools()
|
||||
parent_tools = await parent.list_tools()
|
||||
|
||||
child_tool = next(t for t in child_tools if t.name == "foo")
|
||||
parent_tool = next(t for t in parent_tools if t.name == "foo")
|
||||
|
||||
child_mcp_tool = child_tool.to_mcp_tool(name=child_tool.name)
|
||||
parent_mcp_tool = parent_tool.to_mcp_tool(name=parent_tool.name)
|
||||
|
||||
assert child_mcp_tool.execution is not None
|
||||
assert parent_mcp_tool.execution is not None
|
||||
assert child_mcp_tool.execution.taskSupport == "optional"
|
||||
assert parent_mcp_tool.execution.taskSupport == "optional"
|
||||
|
||||
|
||||
class TestMountedTaskConfigModes:
|
||||
"""Test TaskConfig mode enforcement for mounted tools."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue