Skip to main content
Glama

flush_logs

Clear the Pi-hole query log to remove all recorded DNS queries and free up disk space.

Instructions

Clear the Pi-hole query log.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The flush_logs tool handler function that sends a POST request to '/action/flush/logs' to clear the Pi-hole query log.
    async def flush_logs() -> dict:
        """Clear the Pi-hole query log."""
        return await client.post("/action/flush/logs")
  • The flush_logs tool is registered as a FastMCP tool via the @mcp.tool() decorator within the register function.
    @mcp.tool()
    async def flush_logs() -> dict:
        """Clear the Pi-hole query log."""
        return await client.post("/action/flush/logs")
  • The register() function that accepts a FastMCP instance and registers the flush_logs tool (and other maintenance tools) on it.
    def register(mcp: FastMCP, client: PiholeClient) -> int:
        @mcp.tool()
        async def update_gravity() -> dict:
            """Refresh Pi-hole gravity (adlist database). Takes a minute or more to complete."""
            return await client.post("/action/gravity")
    
        @mcp.tool()
        async def flush_cache() -> dict:
            """Flush the Pi-hole DNS cache."""
            return await client.post("/action/flush/cache")
    
        @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries the full burden for behavioral disclosure. It states the action but does not mention consequences (e.g., permanent deletion, effect on downstream processes), or whether administrative privileges are required.

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 clear sentence with no superfluous words. It is efficiently front-loaded with the verb and resource.

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?

For a simple no-parameter tool, the description adequately states the core function. However, it lacks context about the permanence of the clearing action and any side effects, which would be expected given the lack of annotations. With an output schema present, return value explanation is not needed.

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

Parameters4/5

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

The tool has no parameters and schema coverage is 100% (trivially). Per guidelines, with 0 parameters baseline score is 4. The description does not add parameter info, but none is needed.

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 'Clear' and identifies the exact resource 'Pi-hole query log', making the tool's purpose unmistakable. It clearly distinguishes from sibling tools like flush_cache (which clears a different data store) and log query tools (which read, not clear).

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?

The description provides no guidance on when to use this tool versus alternatives (e.g., flush_cache, or query log reading tools). There is no mention of prerequisites, or situations where clearing the log is appropriate or not.

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