Apply suggestions from code review

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Zino 2025-11-24 14:57:55 +08:00 committed by GitHub
parent ff29b68b27
commit f2ea86875d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -180,7 +180,7 @@ class MCPClientWithAuthRetry(MCPClient):
"""
return self._execute_with_retry(super().list_tools)
def invoke_tool(self, tool_name: str, tool_args: dict[str, Any], _meta: dict[str, Any]) -> CallToolResult:
def invoke_tool(self, tool_name: str, tool_args: dict[str, Any], _meta: dict[str, Any] | None = None) -> CallToolResult:
"""
Invoke a tool on the MCP server with auth retry.

View File

@ -96,7 +96,7 @@ class MCPClient:
response = self._session.list_tools()
return response.tools
def invoke_tool(self, tool_name: str, tool_args: dict[str, Any], _meta: dict[str, Any]) -> CallToolResult:
def invoke_tool(self, tool_name: str, tool_args: dict[str, Any], _meta: dict[str, Any] | None = None) -> CallToolResult:
"""Call a tool"""
if not self._session:
raise ValueError("Session not initialized.")

View File

@ -133,7 +133,7 @@ class MCPTool(Tool):
if value is not None and not (isinstance(value, str) and value.strip() == "")
}
def invoke_remote_mcp_tool(self, tool_parameters: dict[str, Any], _meta: dict[str, Any]) -> CallToolResult:
def invoke_remote_mcp_tool(self, tool_parameters: dict[str, Any], _meta: dict[str, Any] | None) -> CallToolResult:
headers = self.headers.copy() if self.headers else {}
tool_parameters = self._handle_none_parameter(tool_parameters)