Check if tool requires user confirmation.
(
self, tool_name: str, server_url: str | None = None
)
| 1594 | return None |
| 1595 | |
| 1596 | def _should_confirm_tool( |
| 1597 | self, tool_name: str, server_url: str | None = None |
| 1598 | ) -> bool: |
| 1599 | """Check if tool requires user confirmation.""" |
| 1600 | try: |
| 1601 | prefs = get_preference_manager() |
| 1602 | # Trusted domain bypass — skip confirmation entirely |
| 1603 | if server_url and prefs.is_trusted_domain(server_url): |
| 1604 | return False |
| 1605 | return prefs.should_confirm_tool(tool_name) |
| 1606 | except Exception as e: |
| 1607 | logger.warning(f"Error checking tool confirmation preference: {e}") |
| 1608 | return True |
| 1609 | |
| 1610 | def _register_discovered_tools( |
| 1611 | self, |