MCPcopy Create free account
hub / github.com/agent0ai/agent-zero / call_tool

Method call_tool

helpers/mcp_handler.py:1165–1178  ·  view source on GitHub ↗

Call a tool with the given input data

(
        self, tool_name: str, input_data: Dict[str, Any]
    )

Source from the content-addressed store, hash-verified

1163 return MCPTool(agent=agent, name=tool_name, method=None, args={}, message="", loop_data=None)
1164
1165 async def call_tool(
1166 self, tool_name: str, input_data: Dict[str, Any]
1167 ) -> CallToolResult:
1168 """Call a tool with the given input data"""
1169 server_name_part, tool_name_part = _split_qualified_tool_name(tool_name)
1170 matched_server = None
1171 with self.__lock:
1172 for server in self.servers:
1173 if server.name == server_name_part and server.has_tool(tool_name_part):
1174 matched_server = server
1175 break
1176 if matched_server is None:
1177 raise ValueError(f"Tool {tool_name} not found")
1178 return await matched_server.call_tool(tool_name_part, input_data)
1179
1180
1181T = TypeVar("T")

Callers 6

executeMethod · 0.45
call_toolMethod · 0.45
call_toolMethod · 0.45
call_tool_opMethod · 0.45

Calls 2

has_toolMethod · 0.45