Skip to main content
Glama
cfdude

Mac Shell MCP Server

get_pending_commands

Retrieve commands awaiting approval before execution on macOS to maintain security and control over terminal operations.

Instructions

Get the list of commands pending approval

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary MCP tool handler for 'get_pending_commands'. Retrieves pending commands from CommandService and serializes them to JSON in the MCP response format.
    private async handleGetPendingCommands() {
      const pendingCommands = this.commandService.getPendingCommands();
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              pendingCommands.map((cmd) => ({
                id: cmd.id,
                command: cmd.command,
                args: cmd.args,
                requestedAt: cmd.requestedAt,
                requestedBy: cmd.requestedBy,
              })),
              null,
              2,
            ),
          },
        ],
      };
    }
  • src/index.ts:175-182 (registration)
    Tool registration entry in the ListToolsRequestSchema handler, specifying name, description, and empty input schema.
    {
      name: 'get_pending_commands',
      description: 'Get the list of commands pending approval',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • TypeScript interface defining the structure of pending commands returned by the tool.
    export interface PendingCommand {
      /** Unique ID for the command */
      id: string;
      /** The command to execute */
      command: string;
      /** Arguments for the command */
      args: string[];
      /** When the command was requested */
      requestedAt: Date;
      /** Who requested the command */
      requestedBy?: string;
      /** Resolve function to call when approved */
      resolve: (value: { stdout: string; stderr: string }) => void;
      /** Reject function to call when denied */
      reject: (reason: Error) => void;
    }
  • Helper method in CommandService that extracts and returns the list of pending commands from internal state.
    public getPendingCommands(): PendingCommand[] {
      return Array.from(this.pendingCommands.values());
    }
  • src/index.ts:234-235 (registration)
    Dispatch case in CallToolRequestSchema handler that routes 'get_pending_commands' calls to the specific handler method.
    case 'get_pending_commands':
      return await this.handleGetPendingCommands();
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('Get'), implying it's non-destructive, but doesn't cover other aspects like permissions needed, rate limits, response format, or whether it returns all pending commands or a filtered subset. The description is minimal and lacks behavioral context.

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, clear sentence with no wasted words. It's front-loaded with the core purpose and efficiently communicates the tool's function without unnecessary elaboration, making it easy for an agent 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 tool has no annotations, no output schema, and a simple input schema with no parameters, the description is minimal. While it states the purpose, it lacks context about what 'pending approval' means, how commands are structured, or what the return value looks like. For a tool in a security/command approval context, more completeness would be helpful.

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 no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline score of 4 is given since the schema fully covers the absence of parameters.

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 ('Get') and resource ('list of commands pending approval'), making the purpose immediately understandable. It doesn't explicitly distinguish from sibling tools like 'approve_command' or 'deny_command', but the verb 'Get' implies a read operation rather than an action on the commands themselves.

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 'get_whitelist' or 'execute_command'. It doesn't mention prerequisites, context for pending commands, or any exclusions, leaving the agent to infer usage from the tool name alone.

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/cfdude/mac-shell-mcp'

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