Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

sentinel_analytics_rule_template_get

Retrieve a specific Microsoft Sentinel analytics rule template to implement security monitoring and threat detection in your environment.

Instructions

Get a specific Sentinel analytics rule template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The handler class SentinelAnalyticsRuleTemplateGetTool that defines the tool name and implements the core logic in its async run method to retrieve a specific Sentinel analytics rule template using the Azure SDK SecurityInsights client.
    class SentinelAnalyticsRuleTemplateGetTool(MCPToolBase):
        """
        Get details for a specific Sentinel analytics rule template by ID.
        Returns a dict with summary fields and full template details, or error details.
        """
    
        name = "sentinel_analytics_rule_template_get"
        description = "Get a specific Sentinel analytics rule template"
    
        async def run(self, ctx: Context, **kwargs):
            """
            Get details for a specific analytics rule template by ID.
            Parameters:
                ctx (Context): MCP context object.
                template_id (str): The ID of the analytics rule template to retrieve.
                **kwargs: Accepts template_id as direct key or via kwargs["kwargs"].
            Returns:
                dict: Template summary and details, or error dict.
            """
            logger = self.logger
            # Extract template_id using the centralized parameter extraction from MCPToolBase
            template_id = self._extract_param(kwargs, "template_id")
            if not template_id:
                logger.error(
                    "No template_id provided for analytics rule template retrieval."
                )
                return {"error": "No template_id provided."}
            # Extract Azure context
            workspace, resource_group, subscription_id = self.get_azure_context(ctx)
            if not (workspace and resource_group and subscription_id):
                logger.error(
                    "Missing Azure Sentinel context for analytics rule template retrieval."
                )
                return {"error": "Missing Azure Sentinel context."}
            # Get client
            client = self.get_securityinsight_client(subscription_id)
            try:
                template = client.alert_rule_templates.get(
                    resource_group, workspace, template_id
                )
                template_dict = (
                    template.as_dict() if hasattr(template, "as_dict") else dict(template)
                )
                summary = {
                    "id": template_dict.get("id"),
                    "name": template_dict.get("name"),
                    "displayName": template_dict.get("display_name")
                    or template_dict.get("displayName"),
                    "description": template_dict.get("description"),
                    "kind": template_dict.get("kind"),
                }
                summary["_full"] = template_dict
                return summary
            except Exception as e:
                logger.error("Error retrieving analytics rule template: %s", e)
                # pylint: disable=consider-using-f-string
                return {"error": f"Error retrieving analytics rule template: {str(e)}"}
  • The register_tools function that includes the registration call for SentinelAnalyticsRuleTemplateGetTool with the MCP server instance.
    def register_tools(mcp):
        """
        Register all analytics tools with the given MCP server instance.
    
        Args:
            mcp: The MCP server instance to register tools with.
        """
        SentinelAnalyticsRuleListTool.register(mcp)
        SentinelAnalyticsRuleGetTool.register(mcp)
        SentinelAnalyticsRuleTemplatesListTool.register(mcp)
        SentinelAnalyticsRuleTemplateGetTool.register(mcp)
        SentinelAnalyticsRulesCountByTacticTool.register(mcp)
        SentinelAnalyticsRuleTemplatesCountByTacticTool.register(mcp)
        SentinelAnalyticsRulesCountByTechniqueTool.register(mcp)
        SentinelAnalyticsRuleTemplatesCountByTechniqueTool.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 full burden for behavioral disclosure. It states only the basic action ('Get') without any information about authentication requirements, rate limits, error conditions, return format, or whether it's read-only or has side effects. For a tool with zero 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, focused sentence with zero wasted words. It's front-loaded with the core purpose and avoids unnecessary elaboration. While it lacks detail, what's present is structurally efficient and easy to parse.

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 (a tool for retrieving security analytics templates), lack of annotations, 0% schema coverage, no output schema, and incomplete parameter documentation, the description is severely inadequate. It doesn't provide enough context for an agent to understand how to invoke the tool correctly or interpret results.

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 whatsoever—it doesn't explain what 'kwargs' should contain (e.g., a template ID or filter criteria), expected format, or examples. This leaves the parameter completely undocumented.

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 resource ('a specific Sentinel analytics rule template'), making the purpose immediately understandable. It distinguishes from sibling tools like 'sentinel_analytics_rule_templates_list' by specifying retrieval of a single template rather than listing multiple. However, it doesn't fully differentiate from 'sentinel_analytics_rule_get' (which gets rules, not templates), so it's not perfectly specific.

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 (e.g., needing a template ID), compare to sibling tools like 'sentinel_analytics_rule_templates_list' for browsing, or specify use cases. The agent must infer usage from the tool name and context alone.

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