Skip to main content
Glama

remove_from_blacklist

Remove a domain from the Pi-hole deny list to allow previously blocked queries. Helps restore access to blocked domains when needed.

Instructions

Remove a domain from the deny list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for remove_from_blacklist. It URL-encodes the domain and sends a DELETE request to the Pi-hole API endpoint /domains/deny/exact/{domain}.
    @mcp.tool()
    async def remove_from_blacklist(domain: str) -> dict:
        """Remove a domain from the deny list."""
        return await client.delete(f"/domains/deny/exact/{quote(domain, safe='')}")
  • The register function uses the @mcp.tool() decorator to register remove_from_blacklist (and other domain tools) with the FastMCP server.
    def register(mcp: FastMCP, client: PiholeClient) -> int:
        @mcp.tool()
        async def get_whitelist() -> dict:
            """List all exact-match allowed domains."""
            return await client.get("/domains/allow/exact")
    
        @mcp.tool()
        async def get_blacklist() -> dict:
            """List all exact-match blocked domains."""
            return await client.get("/domains/deny/exact")
    
        @mcp.tool()
        async def add_to_whitelist(domain: str, comment: str | None = None) -> dict:
            """Add a domain to the allow list (whitelist)."""
            body: dict = {"domain": domain}
            if comment:
                body["comment"] = comment
            return await client.post("/domains/allow/exact", json=body)
    
        @mcp.tool()
        async def add_to_blacklist(domain: str, comment: str | None = None) -> dict:
            """Add a domain to the deny list (blacklist)."""
            body: dict = {"domain": domain}
            if comment:
                body["comment"] = comment
            return await client.post("/domains/deny/exact", json=body)
    
        @mcp.tool()
        async def remove_from_whitelist(domain: str) -> dict:
            """Remove a domain from the allow list."""
            return await client.delete(f"/domains/allow/exact/{quote(domain, safe='')}")
    
        @mcp.tool()
        async def remove_from_blacklist(domain: str) -> dict:
            """Remove a domain from the deny list."""
            return await client.delete(f"/domains/deny/exact/{quote(domain, safe='')}")
    
        return 6
  • The client.delete method used by remove_from_blacklist to send the HTTP DELETE request to the Pi-hole API.
    async def delete(self, path: str) -> Any:
        return await self.request("DELETE", path)
  • The underlying request method that handles authentication, retries on 401, and error handling for all HTTP requests including the DELETE used by remove_from_blacklist.
    async def request(
        self,
        method: str,
        path: str,
        *,
        params: dict[str, Any] | None = None,
        json: Any | None = None,
    ) -> Any:
        """Issue a request, auto-authenticating and retrying once on 401."""
        sid = await self._ensure_session()
        resp = await self._http.request(
            method,
            path,
            params=params,
            json=json,
            headers={"X-FTL-SID": sid},
        )
        if resp.status_code == 401:
            self._sid = None
            sid = await self._ensure_session()
            resp = await self._http.request(
                method,
                path,
                params=params,
                json=json,
                headers={"X-FTL-SID": sid},
            )
        if resp.status_code >= 400:
            try:
                body = resp.json()
            except ValueError:
                body = resp.text
            raise PiholeAPIError(resp.status_code, f"{method} {path} failed", body)
        if resp.status_code == 204 or not resp.content:
            return None
        return resp.json()
Behavior2/5

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

No annotations exist, so the description must convey behavioral traits. It only says 'Remove' implying mutation, but omits potential side effects, immediacy, or permissions needed.

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 unnecessary words, efficiently conveying the core purpose.

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?

While the tool is simple and an output schema exists, the description lacks usage guidance and parameter details, leaving gaps for an agent to effectively select and invoke it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description should compensate. The parameter 'domain' is not elaborated beyond its name; no format, validation, or example is given.

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 action ('Remove') and the target ('a domain from the deny list'). It distinguishes from sibling tools like add_to_blacklist (opposite) and remove_from_whitelist (different list).

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 alternatives, nor any prerequisites or context (e.g., when removal takes effect).

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/chris2ao/pihole-mcp'

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