Skip to content

Commit 11624b2

Browse files
committed
fix: linting
1 parent ebceff0 commit 11624b2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/strands/tools/mcp/mcp_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,15 @@ def _handle_tool_result(self, tool_use_id: str, call_tool_result: MCPCallToolRes
269269

270270
status: ToolResultStatus = "error" if call_tool_result.isError else "success"
271271
self._log_debug_with_thread("tool execution completed with status: %s", status)
272-
return MCPToolResult(
272+
result = MCPToolResult(
273273
status=status,
274274
toolUseId=tool_use_id,
275275
content=mapped_content,
276-
structuredContent=call_tool_result.structuredContent,
277276
)
277+
if call_tool_result.structuredContent:
278+
result.structuredContent = call_tool_result.structuredContent
279+
280+
return result
278281

279282
async def _async_background_thread(self) -> None:
280283
"""Asynchronous method that runs in the background thread to manage the MCP connection.

0 commit comments

Comments
 (0)