Problem Statement
The current MCP client's call_tool_sync() catches all exceptions and converts them to a generic MCPToolResult with status="error". This makes it hard to distinguish between protocol errors and application-level failures. The current implementation only provides a text message via str(exception).
https://github.com/strands-agents/sdk-python/blob/main/src/strands/tools/mcp/mcp_client.py#L602-L712
Proposed Solution
Add the isError field to MCPToolResult TypedDict and populate it from CallToolResult.isError in the _handle_tool_result() method. This enables differentiation between:
- Application errors (tool executed but failed)
- Protocol/client errors (exception during execution)
Use Case
This allows proper error handling, accurate metrics collection, and better observability in production systems.
Alternatives Solutions
No response
Additional Context
No response