Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_diag_fw_logs

Fetch the latest firewall log entries to analyze traffic and troubleshoot network issues. Specify the number of logs to return.

Instructions

Retrieve recent firewall log entries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of log entries to retrieve (default: 50, max: 5000)

Implementation Reference

  • The handler for opnsense_diag_fw_logs. Parses args with FwLogsSchema (which validates limit as coerced number), makes a GET request to /diagnostics/firewall/log?limit=<limit>, and returns the result as JSON.
    case "opnsense_diag_fw_logs": {
      const parsed = FwLogsSchema.parse(args);
      const result = await client.get(
        `/diagnostics/firewall/log?limit=${parsed.limit}`,
      );
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • FwLogsSchema: Zod schema for opnsense_diag_fw_logs input. Validates 'limit' as a coerced number (int, 1-5000, default 50).
    const FwLogsSchema = z.object({
      limit: z.coerce.number().int().min(1).max(5000).optional().default(50),
    });
  • Tool definition for 'opnsense_diag_fw_logs' in diagnosticsToolDefinitions array. Includes name, description, and inputSchema (limit param).
      name: "opnsense_diag_fw_logs",
      description: "Retrieve recent firewall log entries",
      inputSchema: {
        type: "object" as const,
        properties: {
          limit: {
            type: "number",
            description: "Number of log entries to retrieve (default: 50, max: 5000)",
          },
        },
      },
    },
  • src/index.ts:28-28 (registration)
    Import of diagnosticsToolDefinitions and handleDiagnosticsTool from diagnostics module.
    import { diagnosticsToolDefinitions, handleDiagnosticsTool } from './tools/diagnostics.js';
  • src/index.ts:61-61 (registration)
    Registration: iterates diagnosticsToolDefinitions and maps each tool name (including opnsense_diag_fw_logs) to handleDiagnosticsTool in the toolHandlers Map.
    for (const def of diagnosticsToolDefinitions) toolHandlers.set(def.name, handleDiagnosticsTool);
Behavior2/5

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

No annotations are provided, and the description only mentions 'recent' without specifying recency criteria, pagination, or whether the operation is read-only. Behavioral traits such as authentication requirements, rate limits, or response format are not disclosed.

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 concise sentence with no unnecessary words. It communicates the essential purpose efficiently.

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 output schema, the description fails to indicate the structure of returned log entries (e.g., fields like timestamp, source, action). Without this, an agent cannot interpret the output correctly. The tool is simple but the description lacks completeness for effective use.

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 covers the 'limit' parameter with full description of default and max values. The description adds no additional meaning beyond what the schema already provides, so baseline 3 is appropriate.

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

Purpose5/5

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

The description 'Retrieve recent firewall log entries' clearly states a specific verb ('retrieve') and resource ('firewall log entries'), and distinguishes this tool from other diagnostic log tools by focusing on firewall logs.

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 on when to use this tool versus alternative log retrieval tools (e.g., opnsense_diag_log_gateways, opnsense_diag_log_system). The description does not indicate any prerequisites, limitations, or when not to use it.

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/itunified-io/mcp-opnsense'

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