Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

sentinel_ti_indicator_metrics_collect

Collect metrics for threat intelligence indicators in Microsoft Sentinel to analyze security data and monitor potential threats.

Instructions

Collect metrics for Sentinel threat intelligence indicators

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The core handler function that implements the tool logic. It fetches Azure workspace details, constructs the API endpoint for threat intelligence metrics, calls the API via self.call_api, and returns the metrics or an error.
    async def run(self, ctx: Context, **kwargs):
        """
        Collect metrics for Sentinel Threat Intelligence indicators in the workspace.
    
        Args:
            ctx (Context): The MCP tool context.
            **kwargs: Not used.
    
        Returns:
            dict: Results as described in the class docstring.
        """
        workspace_name, resource_group, subscription_id = self.get_azure_context(ctx)
        valid = self.validate_azure_context(
            True, workspace_name, resource_group, subscription_id, self.logger
        )
        if not valid:
            return {"error": "Missing required Azure context", "valid": False}
        try:
            url = (
                f"https://management.azure.com/subscriptions/{subscription_id}/"
                f"resourceGroups/{resource_group}/providers/Microsoft.OperationalInsights/"
                f"workspaces/{workspace_name}/providers/Microsoft.SecurityInsights/"
                f"threatIntelligence/main/metrics?api-version=2024-01-01-preview"
            )
            metrics = await self.call_api(
                ctx, "GET", url, name="list_ti_indicator_metrics"
            )
            return {"metrics": metrics, "valid": True}
        except Exception as e:
            self.logger.error("Error collecting threat intelligence metrics: %s", e)
            return {
                "error": "Error collecting threat intelligence metrics: %s" % e,
                "valid": False,
            }
  • Class definition including tool name, description, and docstring outlining the expected input (none) and output schema (metrics dict, valid bool, optional error).
    class SentinelThreatIntelligenceIndicatorMetricsCollectTool(MCPToolBase):
        """
        Tool to collect metrics for Sentinel Threat Intelligence indicators.
    
        Returns:
            dict: {
                'metrics': dict,   # Metrics details as returned by the API
                'valid': bool,     # True if successful
                'error': str (optional)
            }
        """
    
        name = "sentinel_ti_indicator_metrics_collect"
        description = "Collect metrics for Sentinel threat intelligence indicators"
  • The registration function that registers this tool (via .register(mcp)) along with other related Sentinel TI tools to the FastMCP instance.
    def register_tools(mcp: FastMCP):
        """
        Register all Sentinel Threat Intelligence tools with the given MCP instance.
    
        Args:
            mcp (FastMCP): The MCP instance to register tools with.
        """
        SentinelThreatIntelligenceIndicatorGetTool.register(mcp)
        SentinelThreatIntelligenceIndicatorMetricsCollectTool.register(mcp)
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does ('Collect metrics') without any details on traits such as whether it's read-only or destructive, authentication requirements, rate limits, or response format. This leaves critical behavioral aspects unspecified.

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 is appropriately sized and front-loaded, making it easy to parse quickly, though it lacks depth.

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

Completeness1/5

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

Given the complexity of a metrics collection tool with no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It fails to provide necessary context such as what metrics are collected, how to interpret results, or behavioral traits, making it insufficient for effective tool use.

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, meaning the schema provides no semantic information. The description adds no parameter details beyond the tool's purpose, failing to explain what 'kwargs' should contain or how to format 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 states the tool's purpose as 'Collect metrics for Sentinel threat intelligence indicators', which provides a clear verb ('Collect') and resource ('metrics for Sentinel threat intelligence indicators'). However, it lacks specificity about what types of metrics are collected or how they differ from other Sentinel-related tools in the sibling list, making it somewhat vague rather than fully distinct.

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. With multiple Sentinel-related tools in the sibling list (e.g., sentinel_ti_indicator_get, sentinel_analytics_rule_list), there is no indication of context, prerequisites, or exclusions for using this metrics collection tool, leaving the agent without usage direction.

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