diff --git a/lib/features/settings/preferences_mcp_section.dart b/lib/features/settings/preferences_mcp_section.dart index 48a09c71..c4300c39 100644 --- a/lib/features/settings/preferences_mcp_section.dart +++ b/lib/features/settings/preferences_mcp_section.dart @@ -349,6 +349,11 @@ class _ActivityRow extends material.StatelessWidget { style: material.TextStyle( color: entry.error != null ? wb.destructive : wb.mutedForeground), ).xSmall(), + // The guard rule that refused the call, when one did. + if (entry.refusalRule != null) + Text('refused by ${entry.refusalRule}') + .xSmall() + .muted(), ], ), ); diff --git a/test/features/settings/preferences_mcp_section_test.dart b/test/features/settings/preferences_mcp_section_test.dart index 1c64c521..e07200e2 100644 --- a/test/features/settings/preferences_mcp_section_test.dart +++ b/test/features/settings/preferences_mcp_section_test.dart @@ -184,6 +184,7 @@ void main() { sqlText: 'DELETE FROM orders', durationMs: 1, error: 'Data-modifying statements are not allowed over MCP.', + refusalRule: 'data_modifying', ), ]; await pump(tester); @@ -192,6 +193,7 @@ void main() { expect(find.text('1 row(s) ยท 12 ms'), findsOneWidget); expect(find.text('Data-modifying statements are not allowed over MCP.'), findsOneWidget); + expect(find.text('refused by data_modifying'), findsOneWidget); await tester.tap(find.byKey(const material.ValueKey('mcp_clear_log'))); await tester.pump();