Test actual tool execution and capture timeout/retry behavior.
()
| 22 | |
| 23 | |
| 24 | async def test_execution(): |
| 25 | """Test actual tool execution and capture timeout/retry behavior.""" |
| 26 | from mcp_cli.tools.manager import ToolManager |
| 27 | |
| 28 | print("=" * 80) |
| 29 | print("SIMPLE MONDAY.COM TOOL EXECUTION TEST") |
| 30 | print("=" * 80) |
| 31 | print() |
| 32 | |
| 33 | # Create tool manager |
| 34 | print("Creating ToolManager for monday server...") |
| 35 | tm = ToolManager( |
| 36 | config_file="server_config.json", |
| 37 | servers=["monday"], |
| 38 | tool_timeout=None, # Let it use config value |
| 39 | ) |
| 40 | |
| 41 | print(f" ToolManager.tool_timeout: {tm.tool_timeout}") |
| 42 | print() |
| 43 | |
| 44 | # Initialize |
| 45 | print("Initializing...") |
| 46 | success = await tm.initialize() |
| 47 | |
| 48 | if not success: |
| 49 | print("❌ Initialization failed!") |
| 50 | return |
| 51 | |
| 52 | print("✓ Initialized successfully") |
| 53 | print(f" Effective timeout: {tm._effective_timeout}s") |
| 54 | print(f" Effective max_retries: {tm._effective_max_retries}") |
| 55 | print() |
| 56 | |
| 57 | # Execute tool and measure |
| 58 | print("-" * 80) |
| 59 | print("EXECUTING: list_workspaces with {limit: 100}") |
| 60 | print("-" * 80) |
| 61 | print("⏱️ Starting execution...") |
| 62 | print() |
| 63 | |
| 64 | start_time = time.time() |
| 65 | |
| 66 | try: |
| 67 | result = await tm.execute_tool("list_workspaces", {"limit": 100}) |
| 68 | elapsed = time.time() - start_time |
| 69 | |
| 70 | print() |
| 71 | print("=" * 80) |
| 72 | print("EXECUTION RESULT") |
| 73 | print("=" * 80) |
| 74 | print(f" Elapsed time: {elapsed:.2f}s") |
| 75 | print(f" Success: {result.success}") |
| 76 | |
| 77 | if not result.success: |
| 78 | print(f" Error: {result.error}") |
| 79 | print() |
| 80 | |
| 81 | # Parse error for timeout and retry info |
no test coverage detected