Skip to main content
Glama

registry

Perform Windows Registry operations to read keys and values, search entries, list subkeys, retrieve startup programs, installed applications, and system information from the registry.

Instructions

Windows Registry operations including reading registry keys, values, and searching registry entries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe registry operation to perform
key_pathNoRegistry key path (e.g., HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion)
value_nameNoRegistry value name to read
search_termNoSearch term for finding registry keys or values
hiveNoRegistry hive to search in (default: HKLM)HKLM
max_depthNoMaximum depth for recursive operations (default: 2)

Implementation Reference

  • Main handler function (run method) that dispatches registry operations based on the 'action' parameter.
    async run(args: {
      action: string;
      key_path?: string;
      value_name?: string;
      search_term?: string;
      hive?: string;
      max_depth?: number;
    }) {
      try {
        switch (args.action) {
          case "read_key":
            return await this.readKey(args.key_path!);
          case "read_value":
            return await this.readValue(args.key_path!, args.value_name!);
          case "search_keys":
            return await this.searchKeys(args.search_term!, args.hive);
          case "list_subkeys":
            return await this.listSubkeys(args.key_path!, args.max_depth);
          case "get_startup_programs":
            return await this.getStartupPrograms();
          case "get_installed_programs":
            return await this.getInstalledPrograms();
          case "get_system_info_from_registry":
            return await this.getSystemInfoFromRegistry();
          default:
            throw new Error(`Unknown action: ${args.action}`);
        }
      } catch (error: any) {
        return {
          content: [{
            type: "text",
            text: `❌ Registry operation failed: ${error.message}`
          }],
          isError: true
        };
      }
    },
  • Input schema defining parameters for different registry operations.
    parameters: {
      type: "object",
      properties: {
        action: {
          type: "string",
          enum: ["read_key", "read_value", "search_keys", "list_subkeys", "get_startup_programs", "get_installed_programs", "get_system_info_from_registry"],
          description: "The registry operation to perform"
        },
        key_path: {
          type: "string",
          description: "Registry key path (e.g., HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion)"
        },
        value_name: {
          type: "string",
          description: "Registry value name to read"
        },
        search_term: {
          type: "string",
          description: "Search term for finding registry keys or values"
        },
        hive: {
          type: "string",
          enum: ["HKLM", "HKCU", "HKCR", "HKU", "HKCC"],
          description: "Registry hive to search in (default: HKLM)",
          default: "HKLM"
        },
        max_depth: {
          type: "number",
          description: "Maximum depth for recursive operations (default: 2)",
          default: 2
        }
      },
      required: ["action"]
    },
  • src/index.ts:42-46 (registration)
    Registration of the registry tool in the MCP server's tool list response.
    {
      name: registryTool.name,
      description: registryTool.description,
      inputSchema: registryTool.parameters
    },
  • src/index.ts:77-78 (registration)
    Dispatch handler for calling the registry tool in the MCP server.
    case "registry":
      return await registryTool.run(args as any);
  • Example helper: reads properties of a registry key using PowerShell.
    async readKey(keyPath: string) {
      try {
        const command = `Get-ItemProperty -Path "Registry::${keyPath}" -ErrorAction Stop | Format-List`;
        const { stdout } = await execAsync(`powershell -Command "${command}"`);
        
        return {
          content: [{
            type: "text",
            text: `# Registry Key: ${keyPath}\n\n\`\`\`\n${stdout}\n\`\`\``
          }]
        };
      } catch (error: any) {
        throw new Error(`Failed to read registry key ${keyPath}: ${error.message}`);
      }
    },
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. While it lists operation types, it doesn't disclose critical behavioral traits like required permissions (admin rights for HKLM), potential system impact (registry modifications can break systems), whether operations are read-only or can modify data, or any rate limits. The description is insufficient for a tool with such sensitive operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with a single sentence that efficiently communicates the core functionality. It's front-loaded with the main purpose and includes specific examples without unnecessary elaboration or repetition.

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?

For a complex tool with 6 parameters, sensitive system operations, and no output schema or annotations, the description is inadequate. It doesn't explain return formats, error conditions, security implications, or provide enough context for safe and effective use. The lack of behavioral transparency and usage guidelines creates significant gaps.

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 schema has 100% description coverage, so the baseline is 3. The description doesn't add any meaningful parameter semantics beyond what's already documented in the schema - it doesn't explain parameter relationships, provide usage examples, or clarify when specific parameters are needed for different actions.

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 performs 'Windows Registry operations' with specific examples (reading keys/values, searching entries), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'system_info' or 'service_manager' that might also interact with system components.

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. There's no mention of when to choose registry operations over sibling tools like 'system_info' or 'filesystem', nor any context about appropriate use cases or prerequisites for registry access.

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/guangxiangdebizi/windows-system-mcp'

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