Skip to main content
Glama
delorenj

Super Windows CLI MCP Server

get_command_history

Retrieve recent command execution records from Windows CLI sessions to review past operations and outputs.

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, validates input limit with Zod schema, retrieves recent history entries from this.commandHistory, truncates outputs, and returns them as 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)
        }]
      };
    }
  • Type definition for CommandHistoryEntry, which structures the data returned by the get_command_history tool.
    export interface CommandHistoryEntry {
      command: string;
      output: string;
      timestamp: string;
      exitCode: number;
      connectionId?: string;
    }
  • src/index.ts:176-207 (registration)
    Tool registration in ListTools handler, including 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})`
                  }
                }
              }
            },
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. It states it retrieves history but doesn't disclose behavioral traits like whether it's read-only (implied by 'Get'), what data format or pagination is used, or any rate limits. The example response adds some context but lacks comprehensive behavioral details.

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 purpose statement. The example usage and response are relevant but could be more concise; however, they earn their place by providing practical context without unnecessary verbosity.

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 minimally adequate. It covers the basic purpose and includes examples, but lacks details on usage guidelines and behavioral transparency, which are gaps for a tool with no annotations.

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, with the 'limit' parameter fully documented. The description doesn't add any parameter semantics beyond what the schema provides, but the example usage illustrates how to use 'limit'. Baseline 3 is appropriate since the schema does the heavy lifting.

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 'Get the history of executed commands', which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'execute_command' or 'ssh_execute', which are for executing commands rather than retrieving history.

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 or provide context about prerequisites, such as whether commands need to have been executed first. The example usage is helpful but doesn't address usage scenarios.

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

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