From 15de7658765f01f5c3482a0827587d02f3b352e8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 18 Jan 2026 22:01:37 -0800 Subject: [PATCH] fix: downgrade MCP tool error logs from warning to debug (#8846) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the log level for expected MCP tool execution failures (ToolError, McpError) from warning to debug in fastmcp_client.py to match base_client.py. These errors occur when an LLM calls an MCP tool with missing/invalid arguments - they are expected user-facing issues from external MCP servers, not system errors that should trigger production alerts. Fixes #8845 🤖 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] Co-authored-by: Kian Jones <11655409+kianjones9@users.noreply.github.com> --- letta/services/mcp/fastmcp_client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/letta/services/mcp/fastmcp_client.py b/letta/services/mcp/fastmcp_client.py index c46cd948..e3c901de 100644 --- a/letta/services/mcp/fastmcp_client.py +++ b/letta/services/mcp/fastmcp_client.py @@ -141,9 +141,10 @@ class AsyncFastMCPSSEClient: except Exception as e: # ToolError is raised by fastmcp for input validation errors (e.g., missing required properties) # McpError is raised for other MCP-related errors - # Both are expected user-facing errors from MCP tools, log at warning level + # Both are expected user-facing issues from external MCP servers + # Log at debug level to avoid triggering production alerts for expected failures if e.__class__.__name__ in ("McpError", "ToolError"): - logger.warning(f"MCP tool '{tool_name}' execution failed: {str(e)}") + logger.debug(f"MCP tool '{tool_name}' execution failed: {str(e)}") raise # Parse content from result @@ -297,9 +298,10 @@ class AsyncFastMCPStreamableHTTPClient: except Exception as e: # ToolError is raised by fastmcp for input validation errors (e.g., missing required properties) # McpError is raised for other MCP-related errors - # Both are expected user-facing errors from MCP tools, log at warning level + # Both are expected user-facing issues from external MCP servers + # Log at debug level to avoid triggering production alerts for expected failures if e.__class__.__name__ in ("McpError", "ToolError"): - logger.warning(f"MCP tool '{tool_name}' execution failed: {str(e)}") + logger.debug(f"MCP tool '{tool_name}' execution failed: {str(e)}") raise # Parse content from result