Skip to main content
Glama
alxspiker

Windows Command Line MCP Server

list_allowed_commands

Discover which Windows command-line operations are permitted by the secure MCP server to ensure safe and controlled system interactions.

Instructions

List all commands that are allowed to be executed by this server. This helps understand what operations are permitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler implementation for list_allowed_commands tool. Returns a markdown-formatted list of allowed commands based on the operating system (Windows-specific powershell.exe and cmd.exe, or Unix equivalents). Includes platform detection and error handling.
    async () => {
      try {
        if (isWindows) {
          return {
            content: [
              {
                type: "text",
                text: "The following commands are allowed to be executed by this server:\n\n" +
                      "- powershell.exe: Used for most system operations\n" +
                      "- cmd.exe: Used for simple command execution\n\n" +
                      "Note: All commands are executed with the same privileges as the user running this server."
              },
            ],
          };
        } else {
          return {
            content: [
              {
                type: "text",
                text: "Running on non-Windows platform: " + platform() + "\n\n" +
                      "Standard Unix/Linux commands are available, but Windows-specific commands like powershell.exe and cmd.exe are not available in this environment.\n\n" +
                      "The following commands should work:\n" +
                      "- ls: List directory contents\n" +
                      "- ps: List processes\n" +
                      "- uname: Print system information\n" +
                      "- ip: Show network information\n\n" +
                      "Note: All commands are executed with the same privileges as the user running this server."
              },
            ],
          };
        }
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error listing allowed commands: ${error}`,
            },
          ],
        };
      }
    }
  • index.ts:396-443 (registration)
    Registration of the list_allowed_commands tool using server.tool(), including name, description, empty input schema, and inline handler function.
    server.tool(
      "list_allowed_commands",
      "List all commands that are allowed to be executed by this server. This helps understand what operations are permitted.",
      {},
      async () => {
        try {
          if (isWindows) {
            return {
              content: [
                {
                  type: "text",
                  text: "The following commands are allowed to be executed by this server:\n\n" +
                        "- powershell.exe: Used for most system operations\n" +
                        "- cmd.exe: Used for simple command execution\n\n" +
                        "Note: All commands are executed with the same privileges as the user running this server."
                },
              ],
            };
          } else {
            return {
              content: [
                {
                  type: "text",
                  text: "Running on non-Windows platform: " + platform() + "\n\n" +
                        "Standard Unix/Linux commands are available, but Windows-specific commands like powershell.exe and cmd.exe are not available in this environment.\n\n" +
                        "The following commands should work:\n" +
                        "- ls: List directory contents\n" +
                        "- ps: List processes\n" +
                        "- uname: Print system information\n" +
                        "- ip: Show network information\n\n" +
                        "Note: All commands are executed with the same privileges as the user running this server."
                },
              ],
            };
          }
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Error listing allowed commands: ${error}`,
              },
            ],
          };
        }
      }
    );
  • Input schema for list_allowed_commands: empty object, indicating no parameters are required.
    {},
Behavior3/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 indicates this is a read operation ('List') for informational purposes, which is clear but lacks details on rate limits, authentication needs, or output format. No contradiction exists, but it's minimal beyond basic intent.

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 two concise sentences that front-load the core purpose and follow with a brief utility statement. Every word earns its place with no redundancy or fluff, making it highly efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no annotations, no output schema), the description is adequate but minimal. It covers the basic purpose and utility but lacks details on behavioral traits like response format or system-specific constraints, which could be helpful for an agent in this server context.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter details, and it correctly aligns with this by not mentioning any parameters, earning a baseline score for parameterless tools.

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 with a specific verb ('List') and resource ('all commands that are allowed to be executed'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'execute_command' or 'get_system_info' beyond the general scope of permissions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by stating 'This helps understand what operations are permitted,' suggesting it's for checking permissions before executing commands. However, it lacks explicit guidance on when to use this versus alternatives like 'execute_command' or other system-info tools, leaving the agent to infer context.

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/alxspiker/Windows-Command-Line-MCP-Server'

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