Skip to main content
Glama
jackalterman

Windows Diagnostics MCP Server

by jackalterman

search_registry

Search the Windows registry by a specified keyword to retrieve entries, with options to limit results. Part of the Windows Diagnostics MCP Server for system analysis.

Instructions

Search the Windows registry by keyword

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum number of results to return (default: 50)
searchTermYesKeyword to search for in the registry

Implementation Reference

  • The main handler function that executes the 'search_registry' tool. It runs a PowerShell script to search the registry, processes the JSON results, formats them into a markdown list, and returns an MCP-formatted response.
    export async function searchRegistry(args: { searchTerm?: string; maxResults?: number }) {
        const searchTerm = args.searchTerm ?? '';
        const maxResults = args.maxResults ?? 50;
      
        const result = await runPowerShellScript(
          REGISTRY_SCRIPT,
          {
            SearchTerm: searchTerm,
            MaxResults: maxResults,
            JsonOutput: true,
          }
        ) as AllTypes.RegistryDiagnosticResults;
      
        const searchResultsText =
          result.SearchResults && result.SearchResults.length > 0
            ? result.SearchResults
                .map(
                  r => `- **Path**: ${r.Path}
      **Type**: ${r.Type}
      **Match**: ${r.Match}
      **Found**: ${r.Found || 'N/A'}
      **Value**: ${r.ValueName || 'N/A'}
      **Data**: ${r.ValueData || 'N/A'}`
                )
                .join('\n\n')
            : 'No results found.';
      
        return {
          content: [
            {
              type: 'text',
              text: `# Registry Search Results for "${searchTerm}"
    
    ${searchResultsText}`,
            },
          ],
        };
      }
  • The input schema definition for the 'search_registry' tool, specifying parameters searchTerm (required string) and maxResults (optional number, default 50).
    inputSchema: {
      type: 'object',
      properties: {
        searchTerm: {
          type: 'string',
          description: 'Keyword to search for in the registry'
        },
        maxResults: {
          type: 'number',
          description: 'Maximum number of results to return (default: 50)',
          default: 50
        }
      },
      required: ['searchTerm']
    }
  • src/index.ts:549-550 (registration)
    The dispatch registration in the CallToolRequestSchema handler that routes calls to the searchRegistry function.
    case 'search_registry':
      return await registry.searchRegistry(args as { searchTerm?: string; maxResults?: number });
  • src/index.ts:118-136 (registration)
    The tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: 'search_registry',
      description: 'Search the Windows registry by keyword',
      inputSchema: {
        type: 'object',
        properties: {
          searchTerm: {
            type: 'string',
            description: 'Keyword to search for in the registry'
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results to return (default: 50)',
            default: 50
          }
        },
        required: ['searchTerm']
      }
    },
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 action is a search but doesn't cover critical aspects like whether this is read-only (likely, but not confirmed), potential system impact, permissions required, rate limits, or what the output looks like (e.g., format, pagination). For a registry tool with zero annotation coverage, this is inadequate.

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 with zero wasted words. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, 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 complexity of registry operations, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., safety, permissions), output format, and usage context relative to siblings. This leaves significant gaps for an AI agent to operate effectively in a multi-tool environment.

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

Parameters3/5

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

The description mentions 'keyword' which maps to the 'searchTerm' parameter, adding some context. However, with 100% schema description coverage, the schema already documents both parameters thoroughly (e.g., 'searchTerm' as 'Keyword to search for', 'maxResults' with default). The description doesn't provide additional syntax, format, or usage details beyond what's in the schema, so it meets the baseline.

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 ('Search') and target resource ('Windows registry') with the method ('by keyword'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'find_orphaned_entries' or 'scan_security_risks' that might also involve registry operations, so it's not a perfect 5.

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, context (e.g., troubleshooting vs. security scanning), or exclusions, leaving the agent to infer usage from the name alone. This is a significant gap given the multiple sibling tools that could overlap.

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

Related 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/jackalterman/windows-diagnostic-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server