mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-01 16:25:44 +08:00
### What problem does this PR solve? Resolves #12105 This PR fixes two MCP tool call issues in `common/mcp_tool_call_conn.py`. First, the timeout passed to `tool_call(..., timeout=...)` was only applied to the outer `future.result(...)` wait, but was not forwarded to the internal MCP request. As a result, callers could pass a longer timeout while the actual MCP request still failed after the default internal timeout. Second, the MCP tool call result handling assumed `result.content[0]` always existed. If an MCP server returned an empty content list, this could raise an exception unexpectedly. This PR fixes both issues by: - forwarding the external `timeout` value to the internal MCP request timeout - returning a clear message when the MCP server returns empty content instead of indexing into an empty list ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe)