Skip to main content
Glama
amittell

firewalla-mcp-server

create_target_list

Create and manage custom target lists of domains, IPs, or CIDR ranges for network security and filtering on the MCP-compatible Firewalla MSP firewall server.

Instructions

Create a new target list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoContent category (optional)
nameYesTarget list name (required, max 24 chars)
notesNoAdditional description (optional)
ownerYesOwner: "global" or box GID (required)
targetsYesArray of domains, IPs, or CIDR ranges (required)

Implementation Reference

  • The CreateTargetListHandler class that extends BaseToolHandler and implements the core execution logic for creating a target list via Firewalla API. Includes input validation for name, owner, targets, category, notes and calls firewalla.createTargetList()
    export class CreateTargetListHandler extends BaseToolHandler { name = 'create_target_list'; description = 'Create a new target list in Firewalla'; category = 'rule' as const; constructor() { super({ enableGeoEnrichment: false, enableFieldNormalization: true, additionalMeta: { data_source: 'target_lists', entity_type: 'target_list_creation', supports_geographic_enrichment: false, supports_field_normalization: true, standardization_version: '2.0.0', }, }); } async execute( args: ToolArgs, firewalla: FirewallaClient ): Promise<ToolResponse> { try { const nameValidation = ParameterValidator.validateRequiredString( args?.name, 'name' ); const ownerValidation = ParameterValidator.validateRequiredString( args?.owner, 'owner' ); const targetsValidation = ParameterValidator.validateArray( args?.targets, 'targets', { required: true } ); const categoryValidation = ParameterValidator.validateEnum( args?.category, 'category', [ 'ad', 'edu', 'games', 'gamble', 'intel', 'p2p', 'porn', 'private', 'social', 'shopping', 'video', 'vpn', ], false ); const notesValidation = ParameterValidator.validateOptionalString( args?.notes, 'notes' ); const validationResult = ParameterValidator.combineValidationResults([ nameValidation, ownerValidation, targetsValidation, categoryValidation, notesValidation, ]); if (!validationResult.isValid) { return createErrorResponse( this.name, 'Parameter validation failed', ErrorType.VALIDATION_ERROR, undefined, validationResult.errors ); } const targetListData: any = { name: nameValidation.sanitizedValue, owner: ownerValidation.sanitizedValue, targets: targetsValidation.sanitizedValue, }; if (categoryValidation.sanitizedValue) { targetListData.category = categoryValidation.sanitizedValue; } if (notesValidation.sanitizedValue) { targetListData.notes = notesValidation.sanitizedValue; } const response = await withToolTimeout( async () => firewalla.createTargetList(targetListData), 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 create target list: ${errorMessage}`, ErrorType.API_ERROR, { name: args?.name, owner: args?.owner } ); } } }
  • Registration of the CreateTargetListHandler instance in the ToolRegistry during automatic handler registration
    this.register(new CreateTargetListHandler());
  • Input schema definition for the create_target_list tool, specifying required parameters and validation rules used by the MCP server
    name: 'create_target_list', description: 'Create a new target list', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Target list name (required, max 24 chars)', maxLength: 24, }, owner: { type: 'string', description: 'Owner: "global" or box GID (required)', }, targets: { type: 'array', items: { type: 'string', }, description: 'Array of domains, IPs, or CIDR ranges (required)', }, category: { type: 'string', enum: [ 'ad', 'edu', 'games', 'gamble', 'intel', 'p2p', 'porn', 'private', 'social', 'shopping', 'video', 'vpn', ], description: 'Content category (optional)', }, notes: { type: 'string', description: 'Additional description (optional)', }, }, required: ['name', 'owner', 'targets'], },
  • Import statement for CreateTargetListHandler from rules.ts in the ToolRegistry file, enabling its registration
    import { GetNetworkRulesHandler, PauseRuleHandler, ResumeRuleHandler, GetTargetListsHandler, GetSpecificTargetListHandler, CreateTargetListHandler, UpdateTargetListHandler, DeleteTargetListHandler, GetNetworkRulesSummaryHandler, } from './handlers/rules.js';

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/amittell/firewalla-mcp-server'

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