Skip to main content
Glama
dstreefkerk

ms-sentinel-mcp-server

by dstreefkerk

tool_docs_search

Search Microsoft Sentinel documentation to find relevant content and return matching file paths for quick access.

Instructions

Full-text search across documentation; returns matching paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kwargsYes

Implementation Reference

  • The `run` method of `ToolDocsSearchTool` class, which executes the tool logic: extracts query and optional k parameters, searches documentation markdown files using case-insensitive regex, and returns matching paths (up to k).
    async def run(self, ctx, **kwargs) -> Any:
        """
        Full-text search across documentation; returns matching paths.
    
        Args:
            ctx: The tool context (unused).
            **kwargs: Should include:
                - query (str): Regex or text to search for in docs.
                - k (int, optional): Max number of results to return (default 10).
    
        Returns:
            dict: {
                'hits': list of relative doc paths containing a match,
                'error': error message if search fails
            }
        """
    
        # Defensive: handle string, None, or dict for kwargs
    
        # Extract parameters using the centralized parameter extraction from MCPToolBase
        query = self._extract_param(kwargs, "query")
        k = self._extract_param(kwargs, "k")
        if not query:
            return {"error": "Missing required parameter: query"}
        try:
            candidates = [str(p.relative_to(DOC_ROOT)) for p in DOC_ROOT.rglob("*.md")]
            pat = re.compile(query, re.I)
            hits = []
            for p in candidates:
                content = (DOC_ROOT / p).read_text(encoding="utf-8")
                if pat.search(content):
                    hits.append(p)
                    if k and len(hits) >= int(k):
                        break
            return {"hits": hits}
        except Exception as e:
            return {"error": f"Failed to search docs: {e}"}
  • Class definition of `ToolDocsSearchTool` inheriting from `MCPToolBase`, including `name`, `description`, and docstring that define the tool's schema for MCP (inputs: query (str), k (int optional); outputs: dict with 'hits' list or 'error').
    class ToolDocsSearchTool(MCPToolBase):
        """Tool for full-text search across documentation; returns matching paths."""
    
        name = "tool_docs_search"
        description = "Full-text search across documentation; returns matching paths."
  • The `register_tools` function that registers the `ToolDocsSearchTool` (and other doc tools) with the MCP server instance via `ToolDocsSearchTool.register(mcp)`. This module is loaded by server.py.
    def register_tools(mcp):
        """Register all documentation tools with the given MCP server instance."""
        ToolDocsListTool.register(mcp)
        ToolDocsGetTool.register(mcp)
        ToolDocsSearchTool.register(mcp)
        LLMInstructionsGetTool.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 mentions the action ('search') and output ('matching paths'), but lacks details on permissions, rate limits, search scope, result format, or error handling. For a search tool with zero annotation coverage, this is insufficient.

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 extremely concise—just one sentence with two clauses. It's front-loaded with the core functionality and wastes no words, 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, no output schema, and minimal parameter information, the description is incomplete. It doesn't cover behavioral aspects like search behavior, result limitations, or error cases, which are critical for a search tool. The context signals show significant gaps in documentation.

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?

The schema has 1 parameter with 0% description coverage, and the tool description provides no information about the 'kwargs' parameter. It doesn't explain what 'kwargs' should contain (e.g., search query, filters) or its format, leaving the parameter's meaning and usage unclear.

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 tool's purpose: 'Full-text search across documentation; returns matching paths.' It specifies the verb ('search'), resource ('documentation'), and output format ('matching paths'). However, it doesn't differentiate from its sibling 'tool_docs_get' and 'tool_docs_list', which also work with documentation.

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 'tool_docs_get' (for retrieving specific documentation) or 'tool_docs_list' (for listing documentation), nor does it specify scenarios where full-text search is preferred over other methods.

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