Update agents/mcp/mcp_client.py
Browse files- agents/mcp/mcp_client.py +2 -2
agents/mcp/mcp_client.py
CHANGED
|
@@ -11,14 +11,14 @@ from mcp.client.session import ClientSession, DEFAULT_CLIENT_INFO
|
|
| 11 |
MCP_SSE_URL_CHESS_POSITION_EVALUATION = "https://bstraehle-chess.hf.space/gradio_api/mcp/sse"
|
| 12 |
MCP_TOOL_CHESS_POSITION_EVALUATION = "chess_position_evaluation"
|
| 13 |
|
| 14 |
-
async def call_mcp_tool_async(mcp_url: str, tool_name: str, arguments: dict, timeout: int =
|
| 15 |
"""Call an MCP tool asynchronously.
|
| 16 |
|
| 17 |
Args:
|
| 18 |
mcp_url (str): The MCP SSE URL
|
| 19 |
tool_name (str): The name of the MCP tool to call
|
| 20 |
arguments (dict): The arguments to pass to the tool
|
| 21 |
-
timeout (int): Timeout in seconds (default:
|
| 22 |
|
| 23 |
Returns:
|
| 24 |
str: The tool result as a string
|
|
|
|
| 11 |
MCP_SSE_URL_CHESS_POSITION_EVALUATION = "https://bstraehle-chess.hf.space/gradio_api/mcp/sse"
|
| 12 |
MCP_TOOL_CHESS_POSITION_EVALUATION = "chess_position_evaluation"
|
| 13 |
|
| 14 |
+
async def call_mcp_tool_async(mcp_url: str, tool_name: str, arguments: dict, timeout: int = 5) -> str:
|
| 15 |
"""Call an MCP tool asynchronously.
|
| 16 |
|
| 17 |
Args:
|
| 18 |
mcp_url (str): The MCP SSE URL
|
| 19 |
tool_name (str): The name of the MCP tool to call
|
| 20 |
arguments (dict): The arguments to pass to the tool
|
| 21 |
+
timeout (int): Timeout in seconds (default: 5)
|
| 22 |
|
| 23 |
Returns:
|
| 24 |
str: The tool result as a string
|