get_top_permitted
Retrieve the most frequently allowed domains in Pi-hole, ordered by query count, to analyze permitted traffic.
Instructions
Get top allowed (permitted) domains by query count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/pihole_mcp/tools/stats.py:18-20 (handler)Handler function for the 'get_top_permitted' tool. Fetches top allowed (permitted) domains by query count via the Pi-hole API, passing 'blocked': 'false' to /stats/top_domains.
async def get_top_permitted(count: int = 10) -> dict: """Get top allowed (permitted) domains by query count.""" return await client.get("/stats/top_domains", params={"blocked": "false", "count": count}) - src/pihole_mcp/tools/stats.py:8-17 (registration)Registered as a FastMCP tool via the @mcp.tool() decorator inside the register() function, which is called from register_all() in server.py.
async def get_stats() -> dict: """Get summary statistics (total queries, blocked queries, blocking percentage, unique domains, clients).""" return await client.get("/stats/summary") @mcp.tool() async def get_top_blocked(count: int = 10) -> dict: """Get top blocked domains by query count.""" return await client.get("/stats/top_domains", params={"blocked": "true", "count": count}) @mcp.tool() - src/pihole_mcp/tools/stats.py:18-18 (schema)Input schema: 'count' is an integer with default 10. Return type is dict (no Pydantic model; the raw Pi-hole API response is returned).
async def get_top_permitted(count: int = 10) -> dict: