Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

sentinel_watchlist_item_get

Retrieve a specific watchlist item from Microsoft Sentinel to access threat intelligence data for security analysis and incident response.

Instructions

Get a specific item from a Sentinel watchlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The SentinelWatchlistItemGetTool class, which defines the tool and contains the 'run' method that implements the core logic for retrieving a specific watchlist item using the Azure SecurityInsights client's watchlist_items.get method.
    class SentinelWatchlistItemGetTool(MCPToolBase):
        """
        Tool for retrieving a specific item from a Microsoft Sentinel watchlist by alias
        and item ID.
        """
    
        name = "sentinel_watchlist_item_get"
        description = "Get a specific item from a Sentinel watchlist"
    
        async def run(self, ctx: Context, **kwargs):
            logger = self.logger
    
            # Extract parameters using the base class method
            watchlist_alias = self._extract_param(kwargs, "watchlist_alias")
            watchlist_item_id = self._extract_param(kwargs, "watchlist_item_id")
    
            if not watchlist_alias:
                return {"error": "watchlist_alias parameter is required"}
            if not watchlist_item_id:
                return {"error": "watchlist_item_id parameter is required"}
    
            # 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:
                # Get the specific watchlist item
                item = await run_in_thread(
                    client.watchlist_items.get,
                    resource_group_name=resource_group,
                    workspace_name=workspace_name,
                    watchlist_alias=watchlist_alias,
                    watchlist_item_id=watchlist_item_id,
                )
    
                # Log the item object to understand its structure
                logger.debug("Watchlist item object: %s", item)
    
                # Create a basic info dictionary with guaranteed attributes
                item_details = {
                    "id": item.id if hasattr(item, "id") else None,
                    "name": item.name if hasattr(item, "name") else None,
                    "watchlistAlias": watchlist_alias,
                }
    
                # Try to access properties directly from the item object first
                try:
                    # Check for direct properties on the item object
                    if hasattr(item, "items_key_value"):
                        item_details["itemsKeyValue"] = item.items_key_value
                    if hasattr(item, "properties") and isinstance(item.properties, dict):
                        item_details["properties"] = item.properties
                    
                    # If we couldn't find any direct properties, try the nested properties approach
                    if len(item_details) <= 3 and hasattr(item, "properties") and not isinstance(item.properties, dict):
                        props = item.properties
                        if hasattr(props, "items_key_value"):
                            item_details["itemsKeyValue"] = props.items_key_value
                        if hasattr(props, "properties"):
                            item_details["properties"] = props.properties
                except Exception as prop_error:
                    # Log the property access error but continue with basic details
                    logger.error("Error accessing watchlist item properties: %s", prop_error)
    
                return {"watchlistItem": item_details, "valid": True}
            except Exception as e:
                logger.error(
                    "Error retrieving watchlist item for alias %s, item ID %s: %s",
                    watchlist_alias,
                    watchlist_item_id,
                    e,
                )
                return {
                    "error": "Error retrieving watchlist item for alias %s, item ID %s: %s"
                    % (watchlist_alias, watchlist_item_id, e)
                }
  • Registration of the SentinelWatchlistItemGetTool with the MCP server instance.
    SentinelWatchlistItemGetTool.register(mcp)
  • Tool name and description, which serve as the schema identifier and usage hint. Parameters (watchlist_alias, watchlist_item_id) are handled in the run method.
    name = "sentinel_watchlist_item_get"
    description = "Get a specific item from a Sentinel watchlist"
Behavior1/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 states 'Get' which implies a read operation, but doesn't disclose any behavioral traits: no information on authentication requirements, rate limits, error conditions, response format, or whether it's idempotent. For a tool with no annotation coverage, this is a significant gap in transparency.

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, clear sentence with zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 read operation with one undocumented parameter), no annotations, and no output schema, the description is incomplete. It lacks details on parameter usage, behavioral context, and expected outputs, which are essential for an AI agent to invoke this tool correctly. The conciseness doesn't compensate for these gaps.

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 0% description coverage with one required parameter named 'kwargs' of type string, which is completely undocumented. The description adds no meaning beyond the schema—it doesn't explain what 'kwargs' should contain (e.g., watchlist ID, item ID, query parameters) or provide any examples. With low schema coverage, the description fails to compensate.

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 ('Get') and target resource ('a specific item from a Sentinel watchlist'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'sentinel_watchlist_get' or 'sentinel_watchlist_items_list', but the specificity of 'item' versus 'watchlist' or 'items' provides some implicit distinction.

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, such as 'sentinel_watchlist_items_list' for listing multiple items or 'sentinel_watchlist_get' for watchlist metadata. It lacks context about prerequisites, like needing a watchlist ID or item identifier, which is critical given the single undocumented parameter.

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