Skip to main content
Glama
coreyhines

coreyhines/opnsense-mcp

aliases

Retrieve firewall aliases such as IP groups or port groups, with optional search filtering by name, type, or content.

Instructions

List firewall aliases (IP groups, port groups, etc)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoFilter by alias name, type, or content

Implementation Reference

  • The execute() method of AliasesTool — core handler logic for the 'aliases' tool. Calls client.search_aliases() and returns results with count and status.
    async def execute(self, params: dict[str, Any] | None = None) -> dict[str, Any]:
        """
        List firewall aliases with optional filtering.
    
        Args:
            params: Optional dict with 'search' key.
    
        Returns:
            Dictionary containing aliases and count.
    
        """
        if params is None:
            params = {}
    
        if not self.client:
            return {"status": "error", "error": "No client available"}
    
        try:
            search = params.get("search", "")
            aliases = await self.client.search_aliases(search)
            return {
                "aliases": aliases,
                "count": len(aliases),
                "status": "success",
            }
        except Exception as e:
            logger.exception("Failed to list firewall aliases")
            return {"status": "error", "error": str(e)}
  • Input schema for the 'aliases' tool: optional 'search' string parameter.
    input_schema = {
        "type": "object",
        "properties": {
            "search": {
                "type": "string",
                "description": "Filter by alias name, type, or content",
                "optional": True,
            },
        },
        "required": [],
    }
  • Tool registration in the tools list endpoint response: name 'aliases' with description and inputSchema.
    {
        "name": "aliases",
        "description": "List firewall aliases (IP groups, port groups, etc)",
        "inputSchema": {
  • Dispatch logic: routes 'aliases' tool calls to AliasesTool.execute().
    if tool_name == "aliases":
        result = await aliases_tool.execute(arguments)
        return {
            "jsonrpc": "2.0",
            "id": msg_id,
            "result": {"content": [{"type": "text", "text": str(result)}]},
        }
  • Instantiation of AliasesTool with client for later use.
    aliases_tool = AliasesTool(client)
    gateway_status_tool = GatewayStatusTool(client)
  • API helper search_aliases() makes POST to /api/firewall/alias/searchItem and returns rows.
    async def search_aliases(self, search: str = "") -> list[dict[str, Any]]:
        """List firewall aliases, optionally filtered."""
        try:
            data = await self._make_request(
                "POST",
                ENDPOINTS["alias"]["search"],
                json={"current": 1, "rowCount": 100, "searchPhrase": search},
            )
            return data.get("rows", []) if isinstance(data, dict) else []
        except Exception:
            logger.exception("Failed to search aliases")
            return []
  • Mock implementation of search_aliases() for testing.
    async def search_aliases(self, search: str = "") -> list[dict[str, Any]]:
        """Return mock firewall aliases."""
        data = self.mock_data.get("aliases", {})
        rows = data.get("rows", []) if isinstance(data, dict) else []
        if not search:
            return rows
        search_lc = search.lower()
        return [
            row
            for row in rows
            if search_lc in str(row.get("name", "")).lower()
            or search_lc in str(row.get("description", "")).lower()
            or search_lc in str(row.get("content", "")).lower()
        ]
  • ENDPOINTS definition: alias search endpoint at /api/firewall/alias/searchItem.
    "alias": {
        "search": "/api/firewall/alias/searchItem",
    },
Behavior2/5

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

With no annotations, description must carry behavioral info. It only says 'List', implying read-only, but lacks details on returns, pagination, or auth requirements.

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?

One sentence, front-loaded with purpose, no unnecessary words. Highly efficient.

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?

No output schema, so description should clarify return format. It doesn't mention if it returns all aliases or supports pagination. Minimal but adequate for a simple list.

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 for 'search' is present (100% coverage). The tool description adds context about alias types but doesn't elaborate on parameter usage beyond the schema.

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 clearly states the tool lists firewall aliases, with specific examples like IP groups and port groups. It distinguishes from siblings as there is no alias creation or deletion tool.

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 on when to use this tool versus alternatives like fw_rules. No mention of when to use the search filter or prerequisites.

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

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