remove_allowed_command
Remove a command from the project's allowed commands list to tighten security and control which commands can be executed in the workspace.
Instructions
Remove a command from the project's allowed commands list
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Command to remove from allowed list |
Implementation Reference
- The handler function that removes a command from the allowed commands list. Loads the project config, finds the command by index, splices it out, and saves the config.
async removeAllowedCommand(command: string): Promise<ToolResult> { try { const config = await this.configService.loadProjectConfig(); const index = config.allowedCommands.indexOf(command); if (index === -1) { return { content: [{ type: 'text', text: `Command '${command}' is not in the allowed list` }] }; } config.allowedCommands.splice(index, 1); await this.configService.saveProjectConfig(config); return { content: [{ type: 'text', text: `Command '${command}' removed from allowed list` }] }; } catch (error) { return { isError: true, content: [{ type: 'text', text: `Failed to remove allowed command: ${error}` }] }; } } - src/toolDefinitions.ts:986-996 (schema)Input schema definition for 'remove_allowed_command' tool, specifying 'command' as a required string parameter.
{ name: 'remove_allowed_command', description: 'Remove a command from the project\'s allowed commands list', inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'Command to remove from allowed list' } }, required: ['command'] } }, - src/index.ts:347-348 (registration)Registration of 'remove_allowed_command' in the tool dispatch switch statement, routing to secureCommandService.removeAllowedCommand(args.command).
case 'remove_allowed_command': return await this.secureCommandService.removeAllowedCommand(args.command);