Skip to main content
Glama
Faucet94

Super Windows CLI MCP Server

by Faucet94

get_command_history

Retrieve a history of previously executed commands on the Windows CLI MCP Server, including details like command, output, timestamp, and exit code, with customizable limit options.

Instructions

Get the history of executed commands

Example usage:

{
  "limit": 5
}

Example response:

[
  {
    "command": "Get-Process",
    "output": "...",
    "timestamp": "2024-03-20T10:30:00Z",
    "exitCode": 0
  }
]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of history entries to return (default: 10, max: 1000)

Implementation Reference

  • Handler for the get_command_history tool. Checks if logging is enabled, parses optional limit parameter (default 10, max from config), retrieves recent history entries from this.commandHistory, truncates long outputs, and returns formatted JSON.
    case "get_command_history": {
      if (!this.config.security.logCommands) {
        return {
          content: [{
            type: "text",
            text: "Command history is disabled in configuration. Consult the server admin for configuration changes (config.json - logCommands)."
          }]
        };
      }
    
      const args = z.object({
        limit: z.number()
          .min(1)
          .max(this.config.security.maxHistorySize)
          .optional()
          .default(10)
      }).parse(request.params.arguments);
    
      const history = this.commandHistory
        .slice(-args.limit)
        .map(entry => ({
          ...entry,
          output: entry.output.slice(0, 1000) // Limit output size
        }));
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify(history, null, 2)
        }]
      };
    }
  • src/index.ts:176-207 (registration)
    Tool registration in ListTools response, defining name, description, and inputSchema for get_command_history.
            {
              name: "get_command_history",
              description: `Get the history of executed commands
    
    Example usage:
    \`\`\`json
    {
      "limit": 5
    }
    \`\`\`
    
    Example response:
    \`\`\`json
    [
      {
        "command": "Get-Process",
        "output": "...",
        "timestamp": "2024-03-20T10:30:00Z",
        "exitCode": 0
      }
    ]
    \`\`\``,
              inputSchema: {
                type: "object",
                properties: {
                  limit: {
                    type: "number",
                    description: `Maximum number of history entries to return (default: 10, max: ${this.config.security.maxHistorySize})`
                  }
                }
              }
            },
  • TypeScript interface defining the structure of each command history entry returned by the tool.
    export interface CommandHistoryEntry {
      command: string;
      output: string;
      timestamp: string;
      exitCode: number;
      connectionId?: string;
    }
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 implies a read-only operation but doesn't specify permissions, rate limits, or whether the history is filtered by session or user. The example response adds some context but lacks comprehensive behavioral traits.

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 sized and front-loaded with the core purpose, followed by helpful examples. However, the example usage and response could be integrated more seamlessly, and some sentences (like the standalone 'Example usage:') are slightly redundant.

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 (1 parameter, no output schema, no annotations), the description is adequate but has gaps. It covers the basic purpose and provides examples, but lacks usage guidelines and behavioral details, making it minimally viable for an agent to use correctly.

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 input schema has 100% description coverage, so the schema already documents the 'limit' parameter thoroughly. The description doesn't add any semantic details beyond what the schema provides, such as explaining how ordering works or what 'history' encompasses, resulting in a baseline score.

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 ('Get') and resource ('history of executed commands'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'execute_command' or 'ssh_execute', which prevents a perfect score.

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 like 'execute_command' or 'ssh_execute', nor does it mention any prerequisites or exclusions. The example usage is helpful but doesn't constitute usage guidelines.

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/Faucet94/super-win-cli-mcp-server'

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