Skip to main content
Glama

remove_from_whitelist

Remove a domain from the allow list to restore ad-blocking and DNS filtering for that domain.

Instructions

Remove a domain from the allow list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'remove_from_whitelist' tool. It sends a DELETE request to /domains/allow/exact/{domain} with URL encoding.
    @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='')}")
  • The register() function in domains.py that registers all domain tools (including remove_from_whitelist) via @mcp.tool() decorator. Called by register_all in __init__.py.
    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 register_all() function that iterates over all tool modules and calls register() on each, which registers remove_from_whitelist via the domains module.
    def register_all(mcp: FastMCP, client: PiholeClient) -> int:
        """Register every tool module against the FastMCP instance. Returns tool count."""
        count = 0
        for module in (stats, queries, blocking, domains, local_dns, maintenance):
            count += module.register(mcp, client)
        return count
  • The server entry point where register_all is called to register all tools including remove_from_whitelist on the FastMCP instance.
    _tool_count = register_all(mcp, _client)
  • The client.delete() method used by remove_from_whitelist to send the HTTP DELETE request to the Pi-hole API.
    async def delete(self, path: str) -> Any:
        return await self.request("DELETE", path)
Behavior2/5

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

No annotations are present, so the description must fully convey behavioral traits. It only states the basic removal action without disclosing whether the operation is immediate, idempotent, or what happens if the domain is not on the allow list. This is insufficient for a write operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no wasted words. It is appropriately concise for a simple tool, though it could benefit from additional context without becoming verbose.

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?

Given the tool's simplicity (one parameter, no nested objects), the description is minimally sufficient but lacks details about error conditions or return values. The presence of an output schema reduces the need for return explanation, but behavioral gaps remain.

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 single parameter 'domain' is implicitly described by the tool description as the domain to remove. However, the schema has 0% description coverage, and the description adds no extra formatting or validation hints beyond the obvious meaning.

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 verb 'Remove' and the resource 'domain from the allow list'. It distinguishes itself from sibling tools like 'remove_from_blacklist' and 'add_to_whitelist' by specifying the target list and action.

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 usage guidelines are provided. The description does not indicate when to use this tool vs alternatives, nor does it mention prerequisites (e.g., domain must already be on allow list) or complementary tools like 'add_to_whitelist'.

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