delete_target_list
Remove specific target lists by ID from Firewalla MCP server to streamline network security management and maintain accurate rule configurations.
Instructions
Delete a target list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Target list ID to delete (required) |
Implementation Reference
- src/tools/handlers/rules.ts:1755-1817 (handler)The DeleteTargetListHandler class implements the core execution logic for the 'delete_target_list' tool. It validates the required 'id' parameter using ParameterValidator, calls firewalla.deleteTargetList(id) within a timeout wrapper, and handles errors appropriately.export class DeleteTargetListHandler extends BaseToolHandler { name = 'delete_target_list'; description = 'Delete a target list from Firewalla'; category = 'rule' as const; constructor() { super({ enableGeoEnrichment: false, enableFieldNormalization: true, additionalMeta: { data_source: 'target_lists', entity_type: 'target_list_deletion', supports_geographic_enrichment: false, supports_field_normalization: true, standardization_version: '2.0.0', }, }); } async execute( args: ToolArgs, firewalla: FirewallaClient ): Promise<ToolResponse> { try { const idValidation = ParameterValidator.validateRequiredString( args?.id, 'id' ); if (!idValidation.isValid) { return createErrorResponse( this.name, 'Parameter validation failed', ErrorType.VALIDATION_ERROR, undefined, idValidation.errors ); } const id = idValidation.sanitizedValue as string; const response = await withToolTimeout( async () => firewalla.deleteTargetList(id), this.name ); return this.createUnifiedResponse(response); } catch (error: unknown) { if (error instanceof TimeoutError) { return createTimeoutErrorResponse(this.name, error.duration, 10000); } const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; return createErrorResponse( this.name, `Failed to delete target list: ${errorMessage}`, ErrorType.API_ERROR, { id: args?.id } ); } } }
- src/server.ts:421-433 (schema)Explicit JSON schema definition for the delete_target_list tool input, specifying a single required 'id' string parameter. This schema is used by the MCP server for tool validation.name: 'delete_target_list', description: 'Delete a target list', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Target list ID to delete (required)', }, }, required: ['id'], }, },
- src/tools/registry.ts:153-153 (registration)Registers the DeleteTargetListHandler instance in the central ToolRegistry during automatic handler registration.this.register(new DeleteTargetListHandler());
- src/tools/registry.ts:47-56 (registration)Imports the DeleteTargetListHandler from the rules handlers module for use in tool registration.GetNetworkRulesHandler, PauseRuleHandler, ResumeRuleHandler, GetTargetListsHandler, GetSpecificTargetListHandler, CreateTargetListHandler, UpdateTargetListHandler, DeleteTargetListHandler, GetNetworkRulesSummaryHandler, } from './handlers/rules.js';