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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
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") - src/pihole_mcp/tools/maintenance.py:19-22 (registration)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") - src/pihole_mcp/tools/maintenance.py:8-19 (registration)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()