diff --git a/sentry_sdk/integrations/mcp.py b/sentry_sdk/integrations/mcp.py index 9a3f076fec..f847a73941 100644 --- a/sentry_sdk/integrations/mcp.py +++ b/sentry_sdk/integrations/mcp.py @@ -298,12 +298,6 @@ async def _instrument_tool_call( SPANDATA.GEN_AI_TOOL_CALL_RESULT, safe_serialize(result_content), ) - # Set content count if result is a dict - if isinstance(result_content, dict): - span.set_attribute( - SPANDATA.MCP_TOOL_RESULT_CONTENT_COUNT, - len(result_content), - ) return result diff --git a/tests/integrations/mcp/test_mcp.py b/tests/integrations/mcp/test_mcp.py index 7cac486de4..ed7946a64d 100644 --- a/tests/integrations/mcp/test_mcp.py +++ b/tests/integrations/mcp/test_mcp.py @@ -320,7 +320,6 @@ async def test_tool(ctx, params): "value": 42, } ) - assert data[SPANDATA.MCP_TOOL_RESULT_CONTENT_COUNT] == 2 @pytest.mark.asyncio @@ -389,7 +388,6 @@ async def test_tool(ctx, params): assert SPANDATA.MCP_SESSION_ID not in data assert SPANDATA.GEN_AI_TOOL_CALL_RESULT not in data - assert SPANDATA.MCP_TOOL_RESULT_CONTENT_COUNT not in data @pytest.mark.asyncio @@ -1183,7 +1181,6 @@ async def test_tool_tuple(ctx, params): "count": 5, } ) - assert data[SPANDATA.MCP_TOOL_RESULT_CONTENT_COUNT] == 2 @pytest.mark.asyncio @@ -1231,7 +1228,6 @@ async def test_tool_tuple(ctx, params): data = span["attributes"] assert SPANDATA.GEN_AI_TOOL_CALL_RESULT not in data - assert SPANDATA.MCP_TOOL_RESULT_CONTENT_COUNT not in data @pytest.mark.asyncio