Skip to main content
Glama
amittell

firewalla-mcp-server

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
NameRequiredDescriptionDefault
idYesTarget list ID (required)

Implementation Reference

  • 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 }
          );
        }
      }
    }
  • 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'],
      },
    },
  • Registers the GetSpecificTargetListHandler instance in the ToolRegistry during automatic tool registration.
    this.register(new GetSpecificTargetListHandler());
  • Imports the GetSpecificTargetListHandler from the rules handlers module.
      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