Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
countNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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})
  • 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()
  • 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:
Behavior2/5

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

With no annotations, the description fails to disclose behavioral traits such as read-only nature, sorting direction, or whether it returns full domains or counts. Only mentions 'by query count' briefly.

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?

One concise sentence without wasted words. However, it lacks structural elements like bullet points that could improve scanability.

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 and presence of output schema, the description is minimally adequate but could add context like 'returns sorted list' or 'read-only operation' for more completeness.

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?

No explanation of the 'count' parameter despite 0% schema coverage. The description does not clarify that it limits the number of results or any other meaning 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 uses a specific verb 'Get' and resource 'top allowed (permitted) domains by query count', clearly distinguishing it from siblings like 'get_top_blocked' and 'get_top_clients'.

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 'get_top_blocked'. Lacks context on prerequisites or scenarios.

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