Skip to content

Commit 6ed7898

Browse files
author
jiangpeiling
committed
🐛 fix mcp tool validate, adapted for fastmcp version 2.12.0. #1362
1 parent ed3c1c3 commit 6ed7898

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/backend/services/test_tool_configuration_service.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,10 +1139,12 @@ async def test_call_mcp_tool_success(self, mock_client_cls):
11391139
mock_client.__aexit__.return_value = None
11401140
mock_client.is_connected.return_value = True
11411141

1142-
# Mock tool result
1142+
# Mock tool result structure to match what _call_mcp_tool expects
1143+
mock_content_item = Mock()
1144+
mock_content_item.text = "test result"
11431145
mock_result = Mock()
1144-
mock_result.text = "test result"
1145-
mock_client.call_tool.return_value = [mock_result]
1146+
mock_result.content = [mock_content_item]
1147+
mock_client.call_tool.return_value = mock_result
11461148

11471149
mock_client_cls.return_value = mock_client
11481150

0 commit comments

Comments
 (0)