Skip to main content
Glama
amittell

firewalla-mcp-server

create_target_list

Create custom network target lists in Firewalla to block or allow specific domains, IP addresses, or CIDR ranges for enhanced security control.

Instructions

Create a new target list

Input Schema

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

Implementation Reference

  • Core handler implementation for the 'create_target_list' tool. Validates inputs, calls Firewalla API, handles errors and returns standardized response.
    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 }
          );
        }
      }
    }
  • MCP protocol input schema definition for the create_target_list tool, used in listTools response. Specifies properties, types, descriptions, enums, and required fields.
    {
      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'],
      },
    },
  • Tool registry where CreateTargetListHandler is instantiated and registered by name in the ToolRegistry during auto-registration.
    // Rule tools (8 handlers)
    this.register(new GetNetworkRulesHandler());
    this.register(new PauseRuleHandler());
    this.register(new ResumeRuleHandler());
    this.register(new GetTargetListsHandler());
    this.register(new GetSpecificTargetListHandler());
    this.register(new CreateTargetListHandler());
    this.register(new UpdateTargetListHandler());
    this.register(new DeleteTargetListHandler());
  • Import statement for CreateTargetListHandler from rules.ts, enabling its use in registry.
    import {
      GetNetworkRulesHandler,
      PauseRuleHandler,
      ResumeRuleHandler,
      GetTargetListsHandler,
      GetSpecificTargetListHandler,
      CreateTargetListHandler,
      UpdateTargetListHandler,
      DeleteTargetListHandler,
      GetNetworkRulesSummaryHandler,
    } from './handlers/rules.js';
  • The registerHandlers method in ToolRegistry constructor that performs all tool registrations including create_target_list.
    }
    
    /**
     * Automatically registers 28 tool handlers for complete API coverage
     *
     * Registers handlers for the 28-tool architecture: 23 direct API endpoints
     * and 5 convenience wrappers. Each handler implements the ToolHandler interface
     * and maps to actual Firewalla API endpoints.
     *
     * @private
     * @returns {void}
     */
    private registerHandlers(): void {
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'create' implies a write operation, it doesn't mention permissions required, whether the creation is idempotent, what happens on duplicate names, or what the response looks like. For a mutation tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is maximally concise with a single clear sentence that states the core function. There's no wasted language or unnecessary elaboration, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what a 'target list' is, what happens after creation, how to verify success, or how this tool relates to other target list operations. The agent would need to guess about important behavioral aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents all 5 parameters. The description adds no additional parameter information beyond what's in the schema. Baseline 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('create') and resource ('target list'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'update_target_list' beyond the basic verb difference, nor does it explain what a 'target list' is in this context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like 'update_target_list' or 'search_target_lists'. The description offers no context about prerequisites, typical use cases, or relationships with other tools in the system.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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