Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

markdown_template_get

Retrieve raw markdown content for specific templates to access structured documentation and configuration guides within Microsoft Sentinel environments.

Instructions

Get the raw markdown content for a specific template by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The MarkdownTemplateGetTool class implements the core handler logic for the 'markdown_template_get' tool. The 'run' method handles input validation, reads the specified markdown template file from the resources/markdown_templates directory, and returns its content or appropriate error messages.
    class MarkdownTemplateGetTool(MCPToolBase):
        """
        Tool for retrieving the raw markdown content for a specific template by name.
        """
    
        name = "markdown_template_get"
        description = "Get the raw markdown content for a specific template by name."
    
        async def run(self, ctx, **kwargs) -> Any:
            """
            Get the raw markdown content for a specific template by name.
    
            Args:
                ctx: The context object (unused).
                **kwargs: Arguments containing 'name' (str), the template name (without extension).
    
            Returns:
                dict: A dictionary containing the template content, or an error message if not found or
                      unreadable.
            """
    
            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)
            # Extract name parameter using the centralized parameter extraction from MCPToolBase
            name = self._extract_param(kwargs, "name")
            if not name or not isinstance(name, str):
                return {"error": "Missing or invalid required parameter: name"}
            try:
                if not TEMPLATE_DIR.exists() or not TEMPLATE_DIR.is_dir():
                    return {
                        "error": f"Markdown templates directory does not exist: {TEMPLATE_DIR}"
                    }
                path = TEMPLATE_DIR / f"{name}.md"
                path.resolve().relative_to(TEMPLATE_DIR.resolve())
                if not path.exists():
                    try:
                        available = [
                            os.path.splitext(f)[0]
                            for f in os.listdir(TEMPLATE_DIR)
                            if f.endswith(".md")
                        ]
                    except Exception as list_exc:
                        self.logger.error("Failed to list templates: %s", list_exc)
                        available = []
                    return {
                        "error": f"Markdown template not found: {name}",
                        "available_templates": available,
                    }
                try:
                    content = path.read_text(encoding="utf-8")
                except Exception as file_exc:
                    self.logger.error("Failed to read template %s: %s", name, file_exc)
                    return {"error": f"Failed to read markdown template: {file_exc}"}
                return {"content": content}
            except Exception as e:
                self.logger.error("Failed to get markdown template '%s': %s", name, e)
                return {"error": f"Failed to get markdown template: {e}"}
  • The register_tools function registers the MarkdownTemplateGetTool with the MCP server by calling its 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)
  • Constant defining the path to the markdown_templates directory used by the tool to locate template files.
    TEMPLATE_DIR = Path(__file__).parent.parent / "resources" / "markdown_templates"
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 'Get' operation, implying read-only behavior, but doesn't specify whether it requires authentication, has rate limits, what happens if the template doesn't exist, or the format of the returned content. This leaves significant gaps 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 purpose and efficiently conveys the essential information without unnecessary elaboration, 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 lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It doesn't explain what 'raw markdown content' entails, error conditions, or behavioral details needed for reliable use. For a tool with such minimal structured data, more context is required to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for the undocumented parameter. It mentions 'by name', which hints that the parameter is a template name, but doesn't specify format, constraints, or examples. This adds minimal value beyond the schema's generic 'kwargs' parameter, failing to fully address the coverage gap.

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 ('raw markdown content for a specific template by name'), making the purpose immediately understandable. It distinguishes from the sibling 'markdown_templates_list' by specifying retrieval of individual content rather than listing. However, it doesn't fully differentiate from other 'get' tools like 'llm_instructions_get' beyond the resource type.

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 name), when not to use it, or how it relates to siblings like 'markdown_templates_list' for discovering available templates first. Usage is implied but not explicitly stated.

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