Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

sentinel_source_controls_list

Retrieve all source controls configured in your Microsoft Sentinel workspace to manage security data ingestion and monitoring.

Instructions

List all Sentinel source controls in the current workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The main execution handler for the 'sentinel_source_controls_list' tool. It retrieves Azure context, lists source controls using the SecurityInsights client, formats them into a dictionary list, and returns a structured result with validation flags and error handling.
    async def run(self, ctx: Context, **kwargs):
        """
        List all source controls in the current Sentinel workspace.
    
        Parameters:
            None required. (Context is extracted from MCP or environment.)
        Returns:
            dict: {
                'source_controls': list[dict],
                'valid': bool,
                'errors': list[str],
                'error': str (optional, present only if an error occurs)
            }
        Output Fields:
            - source_controls: List of source control objects (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
        params = dict(kwargs)
        if "kwargs" in kwargs and isinstance(kwargs["kwargs"], dict):
            params.update(kwargs["kwargs"])
        workspace_name, resource_group, subscription_id = self.get_azure_context(ctx)
        result = {
            "source_controls": [],
            "valid": False,
            "errors": [],
        }
        try:
            client = self.get_securityinsight_client(subscription_id)
            controls = client.source_controls.list(resource_group, workspace_name)
            controls_list = []
            for ctrl in controls:
                controls_list.append(
                    {
                        "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["source_controls"] = controls_list
            result["valid"] = True
        except Exception as ex:
            error_msg = "Error listing source controls: %s" % ex
            logger.exception("%s", error_msg)
            result["error"] = error_msg
            result["errors"].append(error_msg)
        return result
  • Class definition including the tool name, description, and docstring that serves as input/output schema documentation. Inherits from MCPToolBase which likely provides standard schema handling.
    class SentinelSourceControlsListTool(MCPToolBase):
        """
        Tool for listing all Sentinel source controls in the current workspace.
        """
    
        name = "sentinel_source_controls_list"
        description = "List all Sentinel source controls in the current workspace."
  • Explicit registration of the SentinelSourceControlsListTool with the MCP server instance.
    SentinelSourceControlsListTool.register(mcp)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'List all' but doesn't disclose behavioral traits like pagination, rate limits, authentication needs, or what 'current workspace' means. For a list operation with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a parameter with 0% coverage, the description is incomplete. It lacks details on behavior, parameters, return values, and differentiation from siblings, making it insufficient for effective tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter ('kwargs') with 0% description coverage, and the tool description provides no information about parameters. The description doesn't compensate for the lack of schema documentation, leaving the parameter's purpose and usage completely unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List all') and resource ('Sentinel source controls in the current workspace'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'sentinel_source_control_get' (singular vs. plural), which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives (e.g., 'sentinel_source_control_get' for a single source control, or other list tools like 'sentinel_analytics_rule_list'). It only states what it does without context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dstreefkerk/ms-sentinel-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server