Skip to main content
Glama
vespo92

OPNSense MCP Server

create_backup

Generate a configuration backup for OPNSense firewalls, allowing users to save and restore settings. Ideal for maintaining network reliability and ensuring system integrity during changes.

Instructions

Create a configuration backup

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoBackup description

Implementation Reference

  • Input options schema for the createBackup function defining optional backup parameters.
    export interface BackupOptions {
      description?: string;
      compress?: boolean;
      includeRRD?: boolean;
      includeCaptivePortal?: boolean;
    }
  • Main handler function that executes the backup creation: generates ID, downloads config from OPNsense, creates metadata, logs, saves metadata and file, returns BackupInfo.
    async createBackup(options: BackupOptions = {}): Promise<BackupInfo> {
      try {
        // Generate backup ID
        const timestamp = new Date();
        const id = `backup-${timestamp.toISOString().replace(/[:.]/g, '-')}`;
        
        // Download configuration
        const config = await this.downloadConfig();
        
        // Create backup info
        const backupInfo: BackupInfo = {
          id,
          filename: `${id}.xml`,
          timestamp,
          description: options.description || `Automated backup before API operation`,
          size: config.length
        };
    
        // Log backup creation
        console.log(`Created backup: ${backupInfo.id}`);
        
        // Store backup metadata (in production, save to database)
        await this.saveBackupMetadata(backupInfo);
        
        // Store backup file (in production, save to TrueNAS or local storage)
        await this.saveBackupFile(backupInfo.filename, config);
        
        return backupInfo;
      } catch (error: any) {
        throw new Error(`Failed to create backup: ${error.message}`);
      }
    }
  • Output schema for backup information returned by createBackup.
    export interface BackupInfo {
      id: string;
      filename: string;
      timestamp: Date;
      size?: number;
      description?: string;
      checksum?: string;
    }
  • Helper method that creates a backup before executing an operation and returns the backup ID, useful for safe API operations.
    async withBackup<T>(
      operation: () => Promise<T>,
      description?: string
    ): Promise<{ result: T; backupId: string }> {
      // Create backup first
      const backup = await this.createBackup({ description });
      
      try {
        // Execute operation
        const result = await operation();
        
        return {
          result,
          backupId: backup.id
        };
      } catch (error) {
        console.error(`Operation failed. Backup available: ${backup.id}`);
        throw error;
      }
    }
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. It states 'Create a configuration backup' which implies a write operation, but does not cover critical aspects such as permissions required, whether it's idempotent, rate limits, what happens if a backup already exists, or the format/scope of the backup. This leaves significant gaps for an agent to understand the tool's behavior.

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 extremely concise with just three words ('Create a configuration backup'), front-loaded with the core action, and contains no unnecessary information. It efficiently communicates the essence of the tool without waste.

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 the complexity of a backup creation tool (a write operation with potential side effects), no annotations, and no output schema, the description is insufficient. It lacks details on what the backup entails, how to verify success, error handling, or interaction with sibling tools, making it incomplete for safe and effective use by an 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?

The input schema has 100% description coverage for its single parameter ('description'), so the schema already documents it adequately. The description does not add any additional meaning or context about the parameter beyond what the schema provides, such as examples or constraints, but this is acceptable given the 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 'Create a configuration backup' clearly states the action (create) and resource (configuration backup), making the purpose understandable. However, it does not differentiate from sibling tools like 'list_backups' or 'restore_backup', which would require more specificity about what type of backup or 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?

The description provides no guidance on when to use this tool versus alternatives like 'list_backups' or 'restore_backup', nor does it mention prerequisites, dependencies, or typical use cases. It simply states what the tool does without contextual usage 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

Related 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/vespo92/OPNSenseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server