Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

sentinel_watchlists_list

Retrieve all watchlists from Microsoft Sentinel to monitor and manage security threats by listing available threat detection configurations.

Instructions

List all Sentinel watchlists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The handler class SentinelWatchlistsListTool that defines and implements the 'sentinel_watchlists_list' tool. It inherits from MCPToolBase and contains the async run method which lists all watchlists using the Azure SecurityInsights client.
    class SentinelWatchlistsListTool(MCPToolBase):
        """
        Tool for listing all Microsoft Sentinel watchlists in the configured workspace.
        """
    
        name = "sentinel_watchlists_list"
        description = "List all Sentinel watchlists"
    
        async def run(self, ctx: Context, **kwargs):
            logger = self.logger
    
            # Get Azure context and SecurityInsights client using MCPToolBase methods
            workspace_name, resource_group, subscription_id = self.get_azure_context(ctx)
            try:
                client = self.get_securityinsight_client(subscription_id)
            except Exception as e:
                logger.error("Error initializing Azure SecurityInsights client: %s", e)
                return {
                    "error": (
                        "Azure SecurityInsights client initialization failed: %s" % str(e)
                    )
                }
            if client is None:
                return {"error": "Azure SecurityInsights client is not initialized"}
    
            try:
                # List all watchlists
                watchlists = await run_in_thread(
                    client.watchlists.list,
                    resource_group_name=resource_group,
                    workspace_name=workspace_name,
                )
    
                result = []
                for watchlist in watchlists:
                    # Log the watchlist object to understand its structure
                    logger.debug("Watchlist object: %s", watchlist)
    
                    # Create a basic info dictionary with guaranteed attributes
                    watchlist_info = {
                        "id": watchlist.id if hasattr(watchlist, "id") else None,
                        "name": watchlist.name if hasattr(watchlist, "name") else None,
                    }
    
                    # Add properties if they exist
                    if hasattr(watchlist, "properties"):
                        props = watchlist.properties
                        if hasattr(props, "watchlist_alias"):
                            watchlist_info["alias"] = props.watchlist_alias
                        if hasattr(props, "display_name"):
                            watchlist_info["displayName"] = props.display_name
                        if hasattr(props, "description"):
                            watchlist_info["description"] = props.description
                        if hasattr(props, "provider"):
                            watchlist_info["provider"] = props.provider
                        if hasattr(props, "source"):
                            watchlist_info["source"] = props.source
                        if hasattr(props, "items_search_key"):
                            watchlist_info["itemsSearchKey"] = props.items_search_key
                        if hasattr(props, "created_time_utc"):
                            watchlist_info["created"] = props.created_time_utc
                        if hasattr(props, "updated_time_utc"):
                            watchlist_info["updated"] = props.updated_time_utc
                        if hasattr(props, "items_count"):
                            watchlist_info["itemsCount"] = props.items_count
                    result.append(watchlist_info)
    
                return {"watchlists": result, "count": len(result), "valid": True}
            except Exception as e:
                logger.error("Error retrieving watchlists: %s", e)
                return {"error": f"Error retrieving watchlists: {str(e)}"}
  • The register_tools function where SentinelWatchlistsListTool.register(mcp) is called to register the tool with the MCP server.
    def register_tools(mcp: FastMCP):
        """
        Register all Sentinel watchlist tools with the MCP server instance.
    
        Args:
            mcp (FastMCP): The MCP server instance to register tools with.
        """
        SentinelWatchlistsListTool.register(mcp)
        SentinelWatchlistGetTool.register(mcp)
        SentinelWatchlistItemsListTool.register(mcp)
        SentinelWatchlistItemGetTool.register(mcp)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't cover critical aspects like pagination, rate limits, authentication needs, or what 'all' entails (e.g., scope, limits). This leaves significant gaps for an agent to understand how to invoke it effectively.

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 with no wasted words, making it easy to parse. It's front-loaded with the core action and resource, though this brevity contributes to gaps in other dimensions.

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 the complexity (a list operation with 1 undocumented parameter, no annotations, and no output schema), the description is insufficient. It doesn't explain the parameter, behavioral traits, or return format, leaving the agent with minimal guidance beyond the basic purpose. This is particularly problematic for a tool with no structured support from annotations or schema descriptions.

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 required parameter ('kwargs') with 0% description coverage, meaning the schema provides no details about its purpose. The description adds no parameter information beyond the tool name, failing to explain what 'kwargs' represents (e.g., filtering options, pagination tokens) or how to use it, which is inadequate given the low schema coverage.

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

Purpose3/5

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

The description 'List all Sentinel watchlists' clearly states the verb ('List') and resource ('Sentinel watchlists'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'sentinel_watchlist_get' (which retrieves a specific watchlist) or 'sentinel_watchlist_items_list' (which lists items within a watchlist), leaving room for ambiguity about scope.

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. It doesn't mention prerequisites, context, or exclusions, such as whether it's for retrieving all watchlists in bulk versus specific ones, or how it relates to siblings like 'sentinel_watchlist_get' for individual watchlists.

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