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

Method execute_tool

tests/chat/test_tool_processor.py:98–118  ·  view source on GitHub ↗
(self, tool_name, arguments, namespace=None, timeout=None)

Source from the content-addressed store, hash-verified

96 self.executed_args = None
97
98 async def execute_tool(self, tool_name, arguments, namespace=None, timeout=None):
99 self.executed_tool = tool_name
100 self.executed_args = arguments
101 if self.raise_exception:
102 raise Exception("Simulated execute_tool exception")
103
104 # Return a ToolCallResult object, not a dict
105 if self.return_result.get("isError"):
106 return ToolCallResult(
107 tool_name=tool_name,
108 success=False,
109 result=None,
110 error=self.return_result.get("error", "Simulated error"),
111 )
112 else:
113 return ToolCallResult(
114 tool_name=tool_name,
115 success=True,
116 result=self.return_result.get("content"),
117 error=None,
118 )
119
120 async def stream_execute_tools(
121 self, calls, timeout=None, on_tool_start=None, max_concurrency=4

Callers

nothing calls this directly

Calls 2

ToolCallResultClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected