Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

sentinel_analytics_rule_templates_list

Retrieve all Microsoft Sentinel analytics rule templates to implement security monitoring and threat detection workflows.

Instructions

List all Sentinel analytics rule templates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The MCPToolBase subclass implementing the 'sentinel_analytics_rule_templates_list' tool. It defines the tool name, description, and the async run method that lists Sentinel analytics rule templates using the Azure Security Insights client, extracting summaries like id, name, displayName, description, and kind.
    class SentinelAnalyticsRuleTemplatesListTool(MCPToolBase):
        """
        List all Sentinel analytics rule templates in the current workspace.
        Returns a list of template summaries or error details.
        """
    
        name = "sentinel_analytics_rule_templates_list"
        description = "List all Sentinel analytics rule templates"
    
        async def run(self, ctx: Context, **kwargs):
            """
            List all analytics rule templates in the current Sentinel workspace.
            Returns a list of dicts, each containing template summary fields, or
            error details.
    
            Parameters:
                ctx (Context): MCP context object.
                **kwargs: No parameters required.
    
            Returns:
                list[dict]: List of template summaries or error dicts.
            """
            logger = self.logger
            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 templates list."
                )
                return [{"error": "Missing Azure Sentinel context."}]
            try:
                client = self.get_securityinsight_client(subscription_id)
                templates = client.alert_rule_templates.list(resource_group, workspace)
            except Exception as e:
                logger.error("Error listing analytics rule templates: %s", e)
                # pylint: disable=consider-using-f-string
                return [{"error": f"Error listing analytics rule templates: {str(e)}"}]
            results = []
            for template in templates:
                try:
                    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"),
                    }
                    results.append(summary)
                except Exception as e:
                    logger.warning("Error processing template: %s", e)
                    results.append({"error": f"Error processing template: {str(e)}"})
            return results
  • Registration of the SentinelAnalyticsRuleTemplatesListTool class with the MCP server instance inside the register_tools function.
    SentinelAnalyticsRuleTemplatesListTool.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 requirements, or the format of returned data. This is inadequate for a tool with no annotation coverage.

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 wasted words. It's front-loaded with the core action and resource, making it efficient and easy to parse.

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 lack of annotations, no output schema, and a parameter with 0% coverage, the description is incomplete. It covers the basic purpose but misses behavioral details, parameter guidance, and output expectations, which are essential 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 description mentions no parameters, while the schema has one required parameter ('kwargs') with 0% schema description coverage. This leaves the parameter completely undocumented, failing to compensate for the schema gap and providing no semantic context for what 'kwargs' should contain.

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 verb 'List' and the resource 'all Sentinel analytics rule templates', which is specific and unambiguous. However, it doesn't differentiate from sibling tools like 'sentinel_analytics_rule_template_get' (which retrieves a single template) or 'sentinel_analytics_rule_list' (which lists actual rules, not templates), leaving some ambiguity in the tool ecosystem.

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 sibling tools like 'sentinel_analytics_rule_template_get' for single templates or 'sentinel_analytics_rule_list' for actual rules, nor does it specify prerequisites or contexts for usage.

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