sentinel_connectors_get
Retrieve a specific data connector by its ID from Microsoft Sentinel to access security information and configure data ingestion.
Instructions
Get a specific data connector by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kwargs | Yes |
Implementation Reference
- tools/data_connector_tools.py:85-120 (handler)The main execution function of the tool. Extracts Azure context, retrieves the data connector by ID using the Security Insights client, and returns its details or error.async def run(self, ctx: Context, **kwargs): """Retrieve a specific Sentinel data connector by its ID. Args: ctx (Context): The MCP server or test context. **kwargs: Keyword arguments containing 'data_connector_id'. Returns: dict: Connector details or error information. """ logger = self.logger workspace_name, resource_group, subscription_id = self.get_azure_context(ctx) if not (workspace_name and resource_group and subscription_id): logger.error("Missing Azure context for getting data connector.") return {"error": "Missing Azure context for getting data connector."} data_connector_id = self._extract_param(kwargs, "data_connector_id") if not data_connector_id: logger.error("Missing required parameter: data_connector_id") return {"error": "Missing required parameter: data_connector_id"} try: client = self.get_securityinsight_client(subscription_id) connector = client.data_connectors.get( resource_group_name=resource_group, workspace_name=workspace_name, data_connector_id=data_connector_id, ) return { "name": getattr(connector, "name", None), "type": getattr(connector, "type", None), "kind": getattr(connector, "kind", None), "id": getattr(connector, "id", None), "etag": getattr(connector, "etag", None), "properties": getattr(connector, "properties", None), } except Exception as e: logger.error("Error getting data connector: %s", e) return {"error": "Error getting data connector: %s" % str(e)}
- tools/data_connector_tools.py:123-131 (registration)Function that registers the SentinelConnectorsGetTool (and the list tool) with the MCP server instance.def register_tools(mcp): """Register all data connector tools with the MCP server. Args: mcp: The MCP server instance. """ SentinelConnectorsListTool.register(mcp) SentinelConnectorsGetTool.register(mcp)
- tools/data_connector_tools.py:72-84 (schema)Class definition inheriting from MCPToolBase, with tool name 'sentinel_connectors_get' and description defining the tool's purpose and input parameter 'data_connector_id'.class SentinelConnectorsGetTool(MCPToolBase): """ MCP tool for retrieving a specific Sentinel data connector by ID. This tool supports both MCP server context (using ctx.request_context) and direct invocation for integration tests. If ctx.request_context is not present, Azure credentials and context are loaded from environment variables, as required by project architecture guidelines. """ name = "sentinel_connectors_get" description = "Get a specific data connector by ID"