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

Method execute_tool

examples/planning/plan_execution_demo.py:71–83  ·  view source on GitHub ↗
(self, tool_name, arguments, namespace=None, timeout=None)

Source from the content-addressed store, hash-verified

69 return [self.ToolInfo(name=n) for n in self.TOOLS]
70
71 async def execute_tool(self, tool_name, arguments, namespace=None, timeout=None):
72 await asyncio.sleep(self._delay) # Simulate network latency
73 self.call_log.append((tool_name, arguments))
74
75 if tool_name in self._fail_tools:
76 return FakeToolCallResult(
77 tool_name=tool_name,
78 success=False,
79 error=f"Connection refused: {tool_name} server is down",
80 )
81
82 result = self.TOOLS.get(tool_name, f"Result from {tool_name}")
83 return FakeToolCallResult(tool_name=tool_name, result=result)
84
85
86# ── Demo Plans ──────────────────────────────────────────────────────────────

Callers

nothing calls this directly

Calls 2

FakeToolCallResultClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected