Skip to main content
Glama
amittell

firewalla-mcp-server

get_boxes

Retrieve a list of Firewalla boxes to monitor network security devices, manage firewall configurations, and analyze network infrastructure.

Instructions

Retrieve list of Firewalla boxes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupNoGet boxes within a specific group (requires group ID)

Implementation Reference

  • The GetBoxesHandler class implements the core logic for the 'get_boxes' tool. It validates optional group_id parameter, calls firewalla.getBoxes(), normalizes and enriches the box data (including geo-enrichment for public IPs), and returns a unified response with total_boxes and detailed box information.
    export class GetBoxesHandler extends BaseToolHandler {
      name = 'get_boxes';
      description =
        'List all managed Firewalla boxes with status and configuration details.';
      category = 'analytics' as const;
    
      constructor() {
        super({
          enableGeoEnrichment: false,
          enableFieldNormalization: false,
          additionalMeta: {
            data_source: 'flow_trends',
            entity_type: 'historical_flow_data',
            supports_geographic_enrichment: false,
            supports_field_normalization: false,
            standardization_version: '2.0.0',
          },
        });
      }
    
      async execute(
        _args: ToolArgs,
        firewalla: FirewallaClient
      ): Promise<ToolResponse> {
        try {
          const groupIdValidation = ParameterValidator.validateOptionalString(
            _args?.group_id,
            'group_id'
          );
    
          if (!groupIdValidation.isValid) {
            return this.createErrorResponse(
              'Parameter validation failed',
              ErrorType.VALIDATION_ERROR,
              undefined,
              groupIdValidation.errors
            );
          }
    
          const groupId = groupIdValidation.sanitizedValue;
    
          const boxesResponse = await withToolTimeout(
            async () => firewalla.getBoxes(groupId as string),
            this.name
          );
    
          const boxResults = SafeAccess.safeArrayAccess(
            boxesResponse.results,
            (arr: any[]) => arr,
            []
          ) as any[];
    
          const normalizedBoxes = batchNormalize(boxResults, {
            name: (v: any) => sanitizeFieldValue(v, 'Unknown Box').value,
            model: (v: any) => sanitizeFieldValue(v, 'unknown').value,
            mode: (v: any) => sanitizeFieldValue(v, 'unknown').value,
            version: (v: any) => sanitizeFieldValue(v, 'unknown').value,
            group: (v: any) => (v ? normalizeUnknownFields(v) : null),
            location: (v: any) => sanitizeFieldValue(v, 'unknown').value,
            online: (v: any) => Boolean(v),
            gid: (v: any) => sanitizeFieldValue(v, 'unknown').value,
            license: (v: any) => sanitizeFieldValue(v, 'unknown').value,
            publicIP: (v: any) => sanitizeFieldValue(v, 'unknown').value,
            deviceCount: (v: any) => Number(v) || 0,
            ruleCount: (v: any) => Number(v) || 0,
            alarmCount: (v: any) => Number(v) || 0,
          });
    
          const startTime = Date.now();
    
          const boxData = normalizedBoxes.map((box: any) => {
            const timestampNormalized = normalizeTimestamps(box);
            const finalBox = timestampNormalized.data;
    
            return {
              gid: SafeAccess.getNestedValue(finalBox, 'gid', 'unknown'),
              name: finalBox.name,
              model: finalBox.model,
              mode: finalBox.mode,
              version: finalBox.version,
              online: SafeAccess.getNestedValue(finalBox, 'online', false),
              last_seen: SafeAccess.getNestedValue(finalBox, 'lastSeen', 0),
              license: SafeAccess.getNestedValue(finalBox, 'license', null),
              public_ip: finalBox.publicIP || finalBox.public_ip || 'unknown',
              group: finalBox.group,
              location: finalBox.location,
              device_count: SafeAccess.getNestedValue(finalBox, 'deviceCount', 0),
              rule_count: SafeAccess.getNestedValue(finalBox, 'ruleCount', 0),
              alarm_count: SafeAccess.getNestedValue(finalBox, 'alarmCount', 0),
            };
          });
    
          // Apply geographic enrichment for public IP addresses
          const enrichedBoxData = await this.enrichGeoIfNeeded(boxData, [
            'public_ip',
          ]);
    
          const unifiedResponseData = {
            total_boxes: normalizedBoxes.length,
            boxes: enrichedBoxData,
          };
    
          const executionTime = Date.now() - startTime;
          return this.createUnifiedResponse(unifiedResponseData, {
            executionTimeMs: executionTime,
          });
        } catch (error: unknown) {
          const errorMessage =
            error instanceof Error ? error.message : 'Unknown error occurred';
          return this.createErrorResponse(
            `Failed to get boxes: ${errorMessage}`,
            ErrorType.API_ERROR
          );
        }
      }
    }
  • Defines the input schema for the get_boxes tool in the MCP server's tools configuration, specifying an optional 'group' parameter.
    name: 'get_boxes',
    description: 'Retrieve list of Firewalla boxes',
    inputSchema: {
      type: 'object',
      properties: {
        group: {
          type: 'string',
          description:
            'Get boxes within a specific group (requires group ID)',
        },
      },
      required: [],
    },
  • Registers the GetBoxesHandler instance in the central ToolRegistry during initialization.
    this.register(new GetBoxesHandler());
  • Imports the GetBoxesHandler from the analytics handlers module for use in the registry.
    GetBoxesHandler,
    GetSimpleStatisticsHandler,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Retrieve list' which implies a read-only operation, but doesn't disclose behavioral traits like authentication requirements, rate limits, pagination, or what happens if the group parameter is omitted. For a tool with zero annotation coverage, this is inadequate.

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 simple retrieval tool and front-loads the core purpose immediately.

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?

Given no annotations, no output schema, and a simple parameter schema, the description is incomplete. It doesn't explain what a 'Firewalla box' represents in this context, what the return format looks like, or any prerequisites for using the optional group parameter. For a tool that might return critical infrastructure data, more context is needed.

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 the single optional parameter 'group'. The description doesn't add any meaning beyond what the schema provides (e.g., it doesn't explain what a 'Firewalla box' is or how grouping works), meeting 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 'Retrieve' and the resource 'list of Firewalla boxes', making the purpose understandable. However, it doesn't differentiate from siblings like 'get_device_status' or 'get_statistics_by_box' which also retrieve box-related information, preventing a perfect score.

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. With siblings like 'get_device_status' and 'get_statistics_by_box' that might overlap, there's no indication of when this specific list retrieval is appropriate or what distinguishes it from other get_* tools.

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