MCPcopy Create free account
hub / github.com/IBM/mcp-cli / _should_confirm_tool

Method _should_confirm_tool

src/mcp_cli/chat/tool_processor.py:1596–1608  ·  view source on GitHub ↗

Check if tool requires user confirmation.

(
        self, tool_name: str, server_url: str | None = None
    )

Source from the content-addressed store, hash-verified

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,

Calls 3

get_preference_managerFunction · 0.90
is_trusted_domainMethod · 0.80
should_confirm_toolMethod · 0.80