Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_route_list

List all configured static routes on OPNsense firewall to inspect and manage network routing settings.

Instructions

List all configured static routes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for opnsense_route_list: calls client.get('/routes/routes/searchroute') and returns the result as JSON. This is the core execution logic.
    case "opnsense_route_list": {
      const result = await client.get("/routes/routes/searchroute");
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Tool definition registration for opnsense_route_list: defines the tool name, description, and empty input schema (no parameters required).
    export const routingToolDefinitions = [
      {
        name: "opnsense_route_list",
        description: "List all configured static routes",
        inputSchema: { type: "object" as const, properties: {} },
  • src/index.ts:67-67 (registration)
    Maps the tool name 'opnsense_route_list' to handleRoutingTool in the central tool handler registry.
    for (const def of routingToolDefinitions) toolHandlers.set(def.name, handleRoutingTool);
  • The OPNsenseClient.get() method used by the handler to make the API GET request to /routes/routes/searchroute.
      async get<T>(path: string): Promise<T> {
        try {
          const response = await this.http.get<T>(path);
          return response.data;
        } catch (error: unknown) {
          throw extractError(error, `GET ${path}`);
        }
      }
    
      async getRaw(path: string): Promise<string> {
        try {
          const response = await this.http.get<string>(path, {
            responseType: "text",
            headers: { Accept: "application/xml" },
          });
          return response.data;
        } catch (error: unknown) {
          throw extractError(error, `GET ${path} (raw)`);
        }
      }
    
      async post<T>(path: string, data?: unknown): Promise<T> {
        try {
          const response = await this.http.post<T>(path, data ?? {}, {
            headers: { "Content-Type": "application/json" },
          });
          return response.data;
        } catch (error: unknown) {
          throw extractError(error, `POST ${path}`);
        }
      }
    
      async delete<T>(path: string): Promise<T> {
        try {
          const response = await this.http.delete<T>(path);
          return response.data;
        } catch (error: unknown) {
          throw extractError(error, `DELETE ${path}`);
        }
      }
    
      static fromEnv(): OPNsenseClient {
        const url = process.env["OPNSENSE_URL"];
        const apiKey = process.env["OPNSENSE_API_KEY"];
        const apiSecret = process.env["OPNSENSE_API_SECRET"];
    
        if (!url) throw new Error("OPNSENSE_URL environment variable is required");
        if (!apiKey) throw new Error("OPNSENSE_API_KEY environment variable is required");
        if (!apiSecret) throw new Error("OPNSENSE_API_SECRET environment variable is required");
    
        const verifySsl = process.env["OPNSENSE_VERIFY_SSL"] !== "false";
        const timeout = parseInt(process.env["OPNSENSE_TIMEOUT"] ?? "30000", 10);
    
        return new OPNsenseClient({ url, apiKey, apiSecret, verifySsl, timeout });
      }
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does not explicitly state that the tool is read-only or has no side effects, but for a list operation this is somewhat implicit. It could mention that it does not modify state or require special permissions.

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 sentence with no extraneous words. It is perfectly concise and front-loaded with the core action.

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

Completeness3/5

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

The tool has no output schema, so the description should ideally describe what is returned. It only states it lists routes but omits details like fields (gateway, interface, etc.) or any limitations. For a simple list tool, this is acceptable but not complete.

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 no parameters, and schema coverage is 100%. The description adds no parameter-level meaning, but since there are none, a baseline of 3 is appropriate.

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 'List' and the resource 'all configured static routes', distinguishing it from sibling tools like opnsense_route_add, opnsense_route_delete, etc. However, it could be slightly more explicit that it only returns static routes, especially since opnsense_diag_routes might list routes of other types.

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

Usage Guidelines3/5

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

The description does not provide explicit when-to-use or when-not-to-use guidance. It is implied that this tool is for listing static routes while others handle modifications, but no alternatives (like diag_routes) are mentioned. The context is clear but lacks exclusions.

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