mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 05:54:19 +02:00
Add TaskConfig for SEP-1686 execution modes
Expose the full MCP task execution modes (forbidden/optional/required) via TaskConfig instead of just boolean task=True/False.
This commit is contained in:
parent
8771f290bd
commit
a231ea4c3c
19 changed files with 854 additions and 263 deletions
|
|
@ -222,7 +222,7 @@ async def test_tool_functionality_with_annotations():
|
|||
|
||||
|
||||
async def test_task_execution_auto_populated_for_task_enabled_tool():
|
||||
"""Test that execution.task is automatically set when tool has task=True."""
|
||||
"""Test that execution.taskSupport is automatically set when tool has task=True."""
|
||||
mcp = FastMCP("Test Server")
|
||||
|
||||
@mcp.tool(task=True)
|
||||
|
|
@ -235,7 +235,7 @@ async def test_task_execution_auto_populated_for_task_enabled_tool():
|
|||
assert len(tools_result) == 1
|
||||
assert tools_result[0].name == "background_tool"
|
||||
assert tools_result[0].execution is not None
|
||||
assert tools_result[0].execution.task == "optional"
|
||||
assert tools_result[0].execution.taskSupport == "optional" # type: ignore[attr-defined]
|
||||
|
||||
|
||||
async def test_task_execution_omitted_for_task_disabled_tool():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue