update_gravity
Refresh Pi-hole's adlist database to update blocklists and improve ad-blocking performance.
Instructions
Refresh Pi-hole gravity (adlist database). Takes a minute or more to complete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'update_gravity' tool. It posts to the '/action/gravity' endpoint to refresh Pi-hole's adlist database (gravity).
async def update_gravity() -> dict: """Refresh Pi-hole gravity (adlist database). Takes a minute or more to complete.""" return await client.post("/action/gravity") - src/pihole_mcp/tools/maintenance.py:9-12 (registration)The tool is registered via the @mcp.tool() decorator in the register() function of maintenance.py.
@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") - src/pihole_mcp/tools/__init__.py:18-18 (registration)register_all() iterates over all tool modules (including maintenance) and calls their register() function to register all tools on the FastMCP server.
count += module.register(mcp, client) - src/pihole_mcp/server.py:15-15 (registration)The top-level server startup calls register_all() to register all tools including update_gravity on the FastMCP instance.
_tool_count = register_all(mcp, _client)