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

Method execute_tool

tests/tools/test_execution.py:23–37  ·  view source on GitHub ↗
(
        self,
        tool_name: str,
        arguments: dict,
        namespace: str | None = None,
        timeout: float | None = None,
    )

Source from the content-addressed store, hash-verified

21 self.executed_tools: list[str] = []
22
23 async def execute_tool(
24 self,
25 tool_name: str,
26 arguments: dict,
27 namespace: str | None = None,
28 timeout: float | None = None,
29 ) -> ToolCallResult:
30 self.executed_tools.append(tool_name)
31 if tool_name in self.results:
32 return self.results[tool_name]
33 return ToolCallResult(
34 tool_name=tool_name,
35 success=True,
36 result={"output": f"result from {tool_name}"},
37 )
38
39
40# ----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

ToolCallResultClass · 0.90

Tested by

no test coverage detected