fix: downgrade McpError logging from warning to debug level (#8371)

MCP errors from external servers (e.g., "The specified key does not exist")
are user-facing issues, not system errors. Downgrading the log level from
warning to debug prevents these expected failures from triggering production
alerts in Datadog/Sentry.

Fixes #8370

🤖 Generated with [Letta Code](https://letta.com)

Co-authored-by: letta-code <248085862+letta-code@users.noreply.github.com>
Co-authored-by: datadog-official[bot] <datadog-official[bot]@users.noreply.github.com>
Co-authored-by: Kian Jones <11655409+kianjones9@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-01-08 10:05:29 -08:00
committed by Caren Thomas
parent 4d31cecd00
commit adbc47ddc9

View File

@@ -82,7 +82,10 @@ class AsyncBaseMCPClient:
result = await self.session.call_tool(tool_name, tool_args)
except Exception as e:
if e.__class__.__name__ == "McpError":
logger.warning(f"MCP tool '{tool_name}' execution failed: {str(e)}")
# MCP errors are typically user-facing issues from external MCP servers
# (e.g., resource not found, invalid arguments, permission errors)
# Log at debug level to avoid triggering production alerts for expected failures
logger.debug(f"MCP tool '{tool_name}' execution failed: {str(e)}")
raise
parsed_content = []