MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test

Function test

diagnostics/trace_monday_simple.py:11–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11async def test():
12 print("Initializing ToolManager...")
13 tm = ToolManager(
14 config_file="server_config.json",
15 servers=["monday"],
16 )
17
18 await tm.initialize()
19 print(f"✓ Initialized with timeout: {tm._effective_timeout}s\n")
20
21 # Test 1: Simple ping-like tool
22 print("=" * 80)
23 print("TEST 1: list_users_and_teams (should be fast)")
24 print("=" * 80)
25
26 start = time.time()
27 result = await tm.execute_tool("list_users_and_teams", {"getMe": True})
28 elapsed = time.time() - start
29
30 print(f"Result: {result.success}")
31 print(f"Elapsed: {elapsed:.2f}s")
32 if not result.success:
33 print(f"Error: {result.error}")
34 print()
35
36 # Test 2: The problematic list_workspaces
37 print("=" * 80)
38 print("TEST 2: list_workspaces (the slow one)")
39 print("=" * 80)
40
41 start = time.time()
42 result = await tm.execute_tool("list_workspaces", {"limit": 10}) # Small limit
43 elapsed = time.time() - start
44
45 print(f"Result: {result.success}")
46 print(f"Elapsed: {elapsed:.2f}s")
47 if not result.success:
48 print(f"Error: {result.error}")
49
50 await tm.close()
51
52
53if __name__ == "__main__":

Callers 1

Calls 4

initializeMethod · 0.95
execute_toolMethod · 0.95
closeMethod · 0.95
ToolManagerClass · 0.90

Tested by

no test coverage detected