Skip to main content
Glama
cfdude

Super Shell MCP Server

add_to_whitelist

Add shell commands to a security whitelist with designated safety levels to control execution permissions across Windows, macOS, and Linux systems.

Instructions

Add a command to the whitelist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesThe command to whitelist
securityLevelYesSecurity level for the command
descriptionNoDescription of the command

Implementation Reference

  • The primary handler function for the 'add_to_whitelist' tool. It validates the input arguments using Zod, converts the security level string to the appropriate enum value, calls the CommandService's addToWhitelist method, and returns a success response.
    private async handleAddToWhitelist(args: any) {
      const schema = z.object({
        command: z.string(),
        securityLevel: z.enum(['safe', 'requires_approval', 'forbidden']),
        description: z.string().optional(),
      });
    
      const { command, securityLevel, description } = schema.parse(args);
    
      // Map string security level to enum
      const securityLevelEnum = securityLevel === 'safe'
        ? CommandSecurityLevel.SAFE
        : securityLevel === 'requires_approval'
          ? CommandSecurityLevel.REQUIRES_APPROVAL
          : CommandSecurityLevel.FORBIDDEN;
    
      this.commandService.addToWhitelist({
        command,
        securityLevel: securityLevelEnum,
        description,
      });
    
      return {
        content: [
          {
            type: 'text',
            text: `Command '${command}' added to whitelist with security level '${securityLevel}'`,
          },
        ],
      };
    }
  • The input schema definition for the 'add_to_whitelist' tool, registered in the ListTools handler. Defines the expected parameters, types, descriptions, and required fields for MCP tool invocation.
    {
      name: 'add_to_whitelist',
      description: 'Add a command to the whitelist',
      inputSchema: {
        type: 'object',
        properties: {
          command: {
            type: 'string',
            description: 'The command to whitelist',
          },
          securityLevel: {
            type: 'string',
            enum: ['safe', 'requires_approval', 'forbidden'],
            description: 'Security level for the command',
          },
          description: {
            type: 'string',
            description: 'Description of the command',
          },
        },
        required: ['command', 'securityLevel'],
      },
    },
  • src/index.ts:289-290 (registration)
    The switch case in the CallToolRequestSchema handler that registers and routes calls to the 'add_to_whitelist' handler function.
    case 'add_to_whitelist':
      return await this.handleAddToWhitelist(args);
  • The supporting method in CommandService that adds a command entry to the internal whitelist Map.
    public addToWhitelist(entry: CommandWhitelistEntry): void {
      this.whitelist.set(entry.command, entry);
    }
  • TypeScript interface defining the structure of a CommandWhitelistEntry used by the addToWhitelist method.
    export interface CommandWhitelistEntry {
      /** The command path or name */
      command: string;
      /** Security level of the command */
      securityLevel: CommandSecurityLevel;
      /** Allowed arguments (string for exact match, RegExp for pattern match) */
      allowedArgs?: Array<string | RegExp>;
      /** Description of the command for documentation */
      description?: 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 states the tool adds to a whitelist, implying a write operation, but doesn't cover critical aspects like permissions required, whether it overwrites existing entries, error conditions, or side effects. This leaves significant gaps for an agent to understand the tool's behavior.

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, direct sentence that efficiently conveys the core action without any wasted words. It is appropriately sized and front-loaded, making it easy 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's complexity (a write operation with security implications), lack of annotations, and no output schema, the description is insufficient. It doesn't explain what happens after adding (e.g., success response, error handling), how it integrates with the security system, or prerequisites, leaving the agent with incomplete context.

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 clear documentation for all three parameters, including an enum for 'securityLevel'. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline score of 3 where 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 action ('Add') and resource ('command to the whitelist'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'update_security_level' or 'approve_command', which might have overlapping functionality in a security context.

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. For example, it doesn't clarify if this is for initial whitelisting versus updating existing entries, or how it relates to siblings like 'update_security_level' or 'remove_from_whitelist'.

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