sentinel_source_control_get
Retrieve configuration details for a specific Microsoft Sentinel source control by providing its unique ID. This tool helps security teams access and manage source control settings within their Sentinel environment.
Instructions
Get details for a specific Sentinel source control by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kwargs | Yes |
Implementation Reference
- tools/workspace_tools.py:174-242 (handler)SentinelSourceControlGetTool class: the core handler implementation for the 'sentinel_source_control_get' tool. Includes name, description, input parameter extraction (source_control_id), Azure context retrieval, Security Insights client usage to fetch source control details, and structured error handling with output schema in docstring.class SentinelSourceControlGetTool(MCPToolBase): """ Tool for retrieving details for a specific Sentinel source control by ID. """ name = "sentinel_source_control_get" description = "Get details for a specific Sentinel source control by ID." async def run(self, ctx: Context, **kwargs): """ Get details for a specific source control by ID. Parameters: source_control_id (str, required): The ID of the source control to retrieve. Returns: dict: { 'source_control': dict, 'valid': bool, 'errors': list[str], 'error': str (optional, present only if an error occurs) } Output Fields: - source_control: Source control object (id, name, repo, etc.) - valid: True if successful, False otherwise - errors: List of error messages (empty if none) - error: Error message if an error occurs (optional) Error cases will always include an 'error' key for testability. """ logger = self.logger # Extract parameters using the base class method source_control_id = self._extract_param(kwargs, "source_control_id") result = { "source_control": {}, "valid": False, "errors": [], } if not source_control_id: error_msg = "Missing required parameter: source_control_id" logger.error("%s", error_msg) result["error"] = error_msg result["errors"].append(error_msg) return result workspace_name, resource_group, subscription_id = self.get_azure_context(ctx) try: client = self.get_securityinsight_client(subscription_id) ctrl = client.source_controls.get( resource_group, workspace_name, source_control_id ) result["source_control"] = { "id": getattr(ctrl, "id", None), "name": getattr(ctrl, "name", None), "repo_type": getattr(ctrl, "repo_type", None), "repo_url": getattr(ctrl, "repo_url", None), "description": getattr(ctrl, "description", None), "content_types": getattr(ctrl, "content_types", None), "created_time_utc": str(getattr(ctrl, "created_time_utc", "")), "last_modified_time_utc": str( getattr(ctrl, "last_modified_time_utc", "") ), } result["valid"] = True except Exception as ex: error_msg = "Error retrieving source control: %s" % ex logger.exception("%s", error_msg) result["error"] = error_msg result["errors"].append(error_msg) return result
- tools/workspace_tools.py:574-574 (registration)Tool registration call within the register_tools function, adding 'sentinel_source_control_get' to the MCP server.SentinelSourceControlGetTool.register(mcp)