Skip to main content
Glama
amittell

firewalla-mcp-server

update_target_list

Modify an existing target list by updating its name, targets, category, or description to maintain accurate network security rules.

Instructions

Update an existing target list

Input Schema

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

Implementation Reference

  • UpdateTargetListHandler class: defines the tool name, description, category, and implements the execute method which validates parameters (required 'id', optional 'name', 'targets', 'category', 'notes'), constructs updateData from valid params, calls firewalla.updateTargetList(id, updateData), and returns unified response or handles errors.
    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 tool registration in server.ts defines the inputSchema for update_target_list: required 'id' string, optional 'name' (maxLength 24), 'targets' array of strings, 'category' enum of content types, 'notes' string.
    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'],
    },
  • ToolRegistry registers the UpdateTargetListHandler instance by name 'update_target_list' during initialization in registerHandlers() method.
    this.register(new UpdateTargetListHandler());
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Update' implies a mutation operation, it fails to mention permission requirements, whether changes are reversible, rate limits, or what happens to unspecified fields. This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a tool with good schema documentation and gets straight to the point without unnecessary elaboration.

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 mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, or behavioral nuances. Given the complexity of updating a target list with multiple fields and an enum, more contextual information would be helpful for the agent.

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 documents all 5 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema, such as explaining relationships between fields or providing usage examples. This meets the baseline for high schema coverage.

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 ('Update') and resource ('an existing target list'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'create_target_list' beyond the 'existing' qualifier, which is why it doesn't reach a perfect score of 5.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_target_list' or 'delete_target_list'. It mentions 'existing' but doesn't clarify prerequisites, dependencies, or contextual usage scenarios, leaving the agent with insufficient decision-making information.

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