get_specific_target_list
Retrieve a specific target list by ID to access predefined network security rules and configurations for monitoring and management.
Instructions
Retrieve a specific target list by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Target list ID (required) |
Implementation Reference
- src/tools/handlers/rules.ts:1449-1511 (handler)The handler class GetSpecificTargetListHandler implements the core logic for the 'get_specific_target_list' tool. It validates the required 'id' parameter, calls the Firewalla API via firewalla.getSpecificTargetList(id), handles timeouts and errors, and returns a unified response.export class GetSpecificTargetListHandler extends BaseToolHandler { name = 'get_specific_target_list'; description = 'Retrieve a specific target list by ID from Firewalla'; category = 'rule' as const; constructor() { super({ enableGeoEnrichment: false, enableFieldNormalization: true, additionalMeta: { data_source: 'target_lists', entity_type: 'target_list', 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.getSpecificTargetList(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 get target list: ${errorMessage}`, ErrorType.API_ERROR, { id: args?.id } ); } } }
- src/server.ts:309-322 (schema)Defines the input schema for the tool in the ListToolsRequestHandler, specifying that it requires a single 'id' string parameter.{ name: 'get_specific_target_list', description: 'Retrieve a specific target list by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Target list ID (required)', }, }, required: ['id'], }, },
- src/tools/registry.ts:150-150 (registration)Registers the GetSpecificTargetListHandler instance in the ToolRegistry during automatic tool registration.this.register(new GetSpecificTargetListHandler());
- src/tools/registry.ts:47-56 (registration)Imports the GetSpecificTargetListHandler from the rules handlers module.GetNetworkRulesHandler, PauseRuleHandler, ResumeRuleHandler, GetTargetListsHandler, GetSpecificTargetListHandler, CreateTargetListHandler, UpdateTargetListHandler, DeleteTargetListHandler, GetNetworkRulesSummaryHandler, } from './handlers/rules.js';