Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

markdown_templates_list

Browse available markdown templates with descriptions to streamline documentation creation for Microsoft Sentinel security operations.

Instructions

List available markdown templates and their descriptions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The async run method implements the core logic of the markdown_templates_list tool. It scans the markdown_templates directory, reads each .md file, extracts the first line as description if it starts with '#', constructs template info with name, uri, description, and full content, and returns a list of templates or an error.
    async def run(self, ctx, **kwargs) -> Any:
        """
        List available markdown templates and their descriptions.
    
        Args:
            ctx: The context object (unused).
            **kwargs: Optional arguments (unused).
    
        Returns:
            dict: A dictionary containing a list of templates (with name, uri, description, and
                  content), or an error message if the directory cannot be read.
        """
        if isinstance(kwargs, str):
            try:
                kwargs = json.loads(kwargs)
            except Exception:
                kwargs = {}
        elif kwargs is None:
            kwargs = {}
        elif not isinstance(kwargs, dict):
            kwargs = dict(kwargs)
        try:
            if not TEMPLATE_DIR.exists() or not TEMPLATE_DIR.is_dir():
                return {
                    "error": f"Markdown templates directory does not exist: {TEMPLATE_DIR}"
                }
            templates = []
            for fname in os.listdir(TEMPLATE_DIR):
                if fname.endswith(".md"):
                    template_name = os.path.splitext(fname)[0]
                    path = TEMPLATE_DIR / fname
                    try:
                        with open(path, encoding="utf-8") as f:
                            first_line = f.readline().strip()
                            f.seek(0)
                            content = f.read()
                    except Exception as file_exc:
                        self.logger.error(
                            "Failed to read template %s: %s", fname, file_exc
                        )
                        continue
                    templates.append(
                        {
                            "name": template_name,
                            "uri": f"markdown://templates/{template_name}",
                            "description": (
                                first_line
                                if first_line.startswith("#")
                                else "Markdown template"
                            ),
                            "content": content,
                        }
                    )
            return {"templates": templates}
        except Exception as e:
            self.logger.error("Failed to list markdown templates: %s", e)
            return {"error": f"Failed to list markdown templates: {e}"}
  • Class definition including name, description, and docstring that define the tool's schema and metadata. Inherits from MCPToolBase, which likely provides standard input/output handling. No specific input parameters required.
    class MarkdownTemplatesListTool(MCPToolBase):
        """
        Tool for listing available markdown templates and their descriptions.
        """
    
        name = "markdown_templates_list"
        description = "List available markdown templates and their descriptions."
  • The register_tools function registers the MarkdownTemplatesListTool (and related tool) with the MCP server by calling the class register method.
    def register_tools(mcp):
        """
        Register the markdown templates tools with the MCP server.
    
        Args:
            mcp: The MCP server or registry to register the tools with.
        """
        MarkdownTemplatesListTool.register(mcp)
        MarkdownTemplateGetTool.register(mcp)
Behavior2/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. It states the tool lists templates and descriptions, implying a read-only operation, but fails to mention critical details like whether it returns all templates at once, supports pagination, or has rate limits. This leaves significant gaps in understanding how the tool behaves.

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 front-loaded and appropriately sized for a simple list operation, with zero waste.

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 tool with one undocumented parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., format, structure), parameter usage, or behavioral constraints, making it inadequate for effective tool invocation.

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 one required parameter 'kwargs' with 0% description coverage, and the tool description provides no information about parameters. This leaves the parameter undocumented in both schema and description, failing to compensate for the low schema coverage and not adding any semantic value beyond the schema.

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 resource ('available markdown templates and their descriptions'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from its sibling 'markdown_template_get' (which presumably retrieves a single template), leaving room for ambiguity in sibling 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 like 'markdown_template_get' or other list tools in the server. It lacks context about prerequisites, such as whether authentication or specific permissions are required, or any exclusions 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