get_pending_commands
Retrieve a list of shell commands awaiting approval for execution on Super Shell MCP Server, ensuring secure and controlled command processing across Windows, macOS, and Linux systems.
Instructions
Get the list of commands pending approval
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:556-573 (handler)Main handler function for 'get_pending_commands' tool that fetches pending commands from CommandService and serializes them to JSON for the MCP response, excluding internal resolve/reject functions.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:234-241 (registration)MCP tool registration defining the name, description, and empty input schema for 'get_pending_commands'.{ name: 'get_pending_commands', description: 'Get the list of commands pending approval', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:295-296 (handler)Tool dispatcher switch case that routes 'get_pending_commands' calls to the handler method.case 'get_pending_commands': return await this.handleGetPendingCommands();
- Core helper method returning all pending commands from the internal Map.public getPendingCommands(): PendingCommand[] { return Array.from(this.pendingCommands.values()); }
- Type definition for PendingCommand used by getPendingCommands and tool response.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; }