Skip to main content
Glama
cfdude

Super Shell MCP Server

deny_command

Reject pending shell commands with a specified reason to maintain security and control in the Super Shell MCP Server environment.

Instructions

Deny a pending command

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandIdYesID of the command to deny
reasonNoReason for denial

Implementation Reference

  • Primary handler function for the 'deny_command' tool. Validates input with Zod, logs activity, delegates to CommandService.denyCommand, and returns MCP-formatted response.
    private async handleDenyCommand(args: any) {
      const schema = z.object({
        commandId: z.string(),
        reason: z.string().optional(),
      });
    
      logger.debug(`handleDenyCommand called with args: ${JSON.stringify(args)}`);
    
      const { commandId, reason } = schema.parse(args);
    
      logger.debug(`[Denial Attempt] ID: ${commandId}, Reason: ${reason || 'none provided'}`);
    
      try {
        this.commandService.denyCommand(commandId, reason);
        logger.info(`Command denied: ID: ${commandId}, Reason: ${reason || 'none provided'}`);
        
        return {
          content: [
            {
              type: 'text',
              text: `Command denied${reason ? `: ${reason}` : ''}`,
            },
          ],
        };
      } catch (error) {
        logger.error(`[Denial Error] ID: ${commandId}, Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
        
        if (error instanceof Error) {
          return {
            content: [
              {
                type: 'text',
                text: `Command denial failed: ${error.message}`,
              },
            ],
            isError: true,
          };
        }
        throw error;
      }
  • src/index.ts:256-273 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema for 'deny_command'.
    {
      name: 'deny_command',
      description: 'Deny a pending command',
      inputSchema: {
        type: 'object',
        properties: {
          commandId: {
            type: 'string',
            description: 'ID of the command to deny',
          },
          reason: {
            type: 'string',
            description: 'Reason for denial',
          },
        },
        required: ['commandId'],
      },
    },
  • Runtime Zod schema validation for deny_command tool inputs within the handler.
    const schema = z.object({
      commandId: z.string(),
      reason: z.string().optional(),
    });
  • Core denyCommand method in CommandService: removes pending command, emits denial event, rejects promise. Called by tool handler.
    public denyCommand(commandId: string, reason: string = 'Command denied'): void {
      const pendingCommand = this.pendingCommands.get(commandId);
      if (!pendingCommand) {
        throw new Error(`No pending command with ID: ${commandId}`);
      }
    
      // Remove from pending queue
      this.pendingCommands.delete(commandId);
      
      // Emit event for denied command
      this.emit('command:denied', { commandId, reason });
      
      // Reject the original promise
      pendingCommand.reject(new Error(reason));
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Deny' implies a mutation that changes command status, but the description doesn't disclose behavioral traits like required permissions, whether denial is reversible, what happens to the denied command, or any side effects. This is a significant gap for a mutation tool with zero annotation coverage.

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, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place.

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 complexity of a command denial operation (a mutation with potential security implications), no annotations, no output schema, and sibling tools like 'approve_command', the description is incomplete. It lacks context on prerequisites, consequences, alternatives, or return values, leaving significant gaps for an AI agent to use it 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?

Schema description coverage is 100%, so the schema already documents both parameters (commandId and reason) adequately. The description doesn't add any meaning beyond what the schema provides, such as explaining what constitutes a valid reason or how the commandId is obtained. Baseline 3 is appropriate when 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 'Deny a pending command' clearly states the action (deny) and target resource (pending command). It's specific and unambiguous, though it doesn't explicitly differentiate from sibling tools like 'approve_command' or 'execute_command' beyond the verb choice.

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 prerequisites (e.g., needing a pending command ID), when denial is appropriate, or how it differs from 'approve_command' or other command-handling tools in the sibling list.

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

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