sentinel_ml_analytics_settings_list
Retrieve all machine learning analytics configurations from your Microsoft Sentinel workspace to monitor and manage security settings.
Instructions
List all Sentinel ML analytics settings in the current workspace.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kwargs | Yes |
Implementation Reference
- tools/workspace_tools.py:404-452 (handler)The `SentinelMLAnalyticsSettingsListTool` class defines the tool implementation. The `run` method is the core handler that retrieves ML analytics settings from the Sentinel workspace using the Azure Security Insights client, handling errors and returning a structured result.class SentinelMLAnalyticsSettingsListTool(MCPToolBase): """Tool for listing all Sentinel ML analytics settings in the current workspace.""" name = "sentinel_ml_analytics_settings_list" description = "List all Sentinel ML analytics settings in the current workspace." async def run(self, ctx: Context, **kwargs): """ List all ML analytics settings in the current Sentinel workspace. Returns MCP-compliant dict with 'settings', 'valid', 'errors', and 'error'. """ logger = self.logger result = {"settings": [], "valid": False, "errors": []} workspace_name, resource_group, subscription_id = self.get_azure_context(ctx) if not (workspace_name and resource_group and subscription_id): error_msg = ( "Missing required Azure context (workspace_name, resource_group, " "subscription_id)." ) logger.error(error_msg) result["error"] = error_msg result["errors"].append(error_msg) return result try: client = self.get_securityinsight_client(subscription_id) # Use the preview API version for ML Analytics support ml_settings_paged = client.security_ml_analytics_settings.list( resource_group, workspace_name ) settings = [] for s in ml_settings_paged: s_dict = s.as_dict() if hasattr(s, "as_dict") else dict(s) settings.append( { "id": s_dict.get("id"), "name": s_dict.get("name"), "description": s_dict.get("description"), "enabled": s_dict.get("enabled"), } ) result["settings"] = settings result["valid"] = True except Exception as ex: error_msg = f"Error listing ML analytics settings: {ex}" logger.exception(error_msg) result["error"] = error_msg result["errors"].append(error_msg) return result
- tools/workspace_tools.py:570-579 (registration)The `register_tools` function registers the `SentinelMLAnalyticsSettingsListTool` (and other tools) with the MCP server instance via the `register` class method.def register_tools(mcp): """Register all Sentinel workspace-related tools with the MCP server instance.""" SentinelWorkspaceGetTool.register(mcp) SentinelSourceControlsListTool.register(mcp) SentinelSourceControlGetTool.register(mcp) SentinelMetadataListTool.register(mcp) SentinelMetadataGetTool.register(mcp) SentinelMLAnalyticsSettingsListTool.register(mcp) SentinelMLAnalyticsSettingGetTool.register(mcp)