Skip to main content
Glama
amittell

firewalla-mcp-server

update_target_list

Modify an existing target list by updating its ID, name, content category, targets (domains, IPs, or CIDR ranges), and notes for precise network security management.

Instructions

Update an existing target list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoUpdated content category
idYesTarget list ID (required)
nameNoUpdated target list name (max 24 chars)
notesNoUpdated description
targetsNoUpdated array of domains, IPs, or CIDR ranges

Implementation Reference

  • The UpdateTargetListHandler class that executes the tool logic: validates input parameters, calls the Firewalla API to update the target list, and formats the response.
    export class UpdateTargetListHandler extends BaseToolHandler { name = 'update_target_list'; description = 'Update an existing target list in Firewalla'; category = 'rule' as const; constructor() { super({ enableGeoEnrichment: false, enableFieldNormalization: true, additionalMeta: { data_source: 'target_lists', entity_type: 'target_list_update', 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' ); const nameValidation = ParameterValidator.validateOptionalString( args?.name, 'name' ); const targetsValidation = ParameterValidator.validateArray( args?.targets, 'targets', { required: false } ); 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([ idValidation, nameValidation, targetsValidation, categoryValidation, notesValidation, ]); if (!validationResult.isValid) { return createErrorResponse( this.name, 'Parameter validation failed', ErrorType.VALIDATION_ERROR, undefined, validationResult.errors ); } const id = idValidation.sanitizedValue as string; const updateData: Record<string, unknown> = {}; if (nameValidation.sanitizedValue !== undefined) { updateData.name = nameValidation.sanitizedValue; } if (targetsValidation.sanitizedValue !== undefined) { updateData.targets = targetsValidation.sanitizedValue; } if (categoryValidation.sanitizedValue !== undefined) { updateData.category = categoryValidation.sanitizedValue; } if (notesValidation.sanitizedValue !== undefined) { updateData.notes = notesValidation.sanitizedValue; } const response = await withToolTimeout( async () => firewalla.updateTargetList(id, updateData), 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 update target list: ${errorMessage}`, ErrorType.API_ERROR, { id: args?.id } ); } } }
  • MCP input schema definition for the update_target_list tool, specifying parameters, types, descriptions, and required fields.
    name: 'update_target_list', description: 'Update an existing target list', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Target list ID (required)', }, name: { type: 'string', description: 'Updated target list name (max 24 chars)', maxLength: 24, }, targets: { type: 'array', items: { type: 'string', }, description: 'Updated array of domains, IPs, or CIDR ranges', }, category: { type: 'string', enum: [ 'ad', 'edu', 'games', 'gamble', 'intel', 'p2p', 'porn', 'private', 'social', 'shopping', 'video', 'vpn', ], description: 'Updated content category', }, notes: { type: 'string', description: 'Updated description', }, }, required: ['id'], }, },
  • Registration of the UpdateTargetListHandler instance in the central ToolRegistry.
    this.register(new UpdateTargetListHandler());

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