Skip to main content
Glama

remove_local_a_record

Delete a local A record from Pi-hole DNS for a specified host to maintain accurate name resolution.

Instructions

Remove any local A record matching the given host.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for remove_local_a_record tool. Fetches current DNS config, filters out any host entry ending with the given host name, and patches DNS config with the updated host list.
    @mcp.tool()
    async def remove_local_a_record(host: str) -> dict:
        """Remove any local A record matching the given host."""
        dns = await _current_dns_config(client)
        hosts = [h for h in dns.get("hosts", []) if not h.endswith(f" {host}")]
        return await _patch_dns(client, {"hosts": hosts})
  • Registered as an MCP tool via the @mcp.tool() decorator inside the register() function of local_dns.py module.
    @mcp.tool()
    async def remove_local_a_record(host: str) -> dict:
        """Remove any local A record matching the given host."""
        dns = await _current_dns_config(client)
        hosts = [h for h in dns.get("hosts", []) if not h.endswith(f" {host}")]
        return await _patch_dns(client, {"hosts": hosts})
  • Helper function to fetch the current DNS configuration from the Pi-hole API.
    async def _current_dns_config(client: PiholeClient) -> dict:
        payload = await client.get("/config/dns")
        config = payload.get("config") or {}
        dns = config.get("dns") or {}
        return dns
    
    
    async def _patch_dns(client: PiholeClient, dns_delta: dict) -> dict:
        return await client.patch("/config/dns", json={"config": {"dns": dns_delta}})
  • Helper function to patch the DNS configuration via the Pi-hole API.
    async def _patch_dns(client: PiholeClient, dns_delta: dict) -> dict:
        return await client.patch("/config/dns", json={"config": {"dns": dns_delta}})
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It does not disclose behavior on missing records, idempotency, side effects, or confirmation requirements.

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?

The description is a single concise sentence with no unnecessary words. However, it could be slightly expanded to include more useful details without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, the description fails to convey what happens after removal (e.g., success indication, error handling, or returned data). This leaves an agent uncertain about the tool's behavior.

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

Parameters3/5

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

The description explains that the 'host' parameter is used for matching, which adds meaning beyond the bare schema, but it lacks specifics on format, case sensitivity, or exact matching rules.

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 clearly states the action ('remove') and the resource ('local A record'), and it is distinct from sibling tools like 'add_local_a_record' and 'remove_local_cname_record'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance is given. The context is implied from the sibling names, but there is no mention of prerequisites or alternatives.

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