Skip to main content
Glama

get_query_suggestions

Retrieve available filter values for query logs, including domains, clients, upstreams, types, and statuses.

Instructions

Get available filter values for the query log (domains, clients, upstreams, types, statuses).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async function 'get_query_suggestions' implements the tool handler. It calls client.get('/queries/suggestions') to fetch available filter values (domains, clients, upstreams, types, statuses) for the query log.
    @mcp.tool()
    async def get_query_suggestions() -> dict:
        """Get available filter values for the query log (domains, clients, upstreams, types, statuses)."""
        return await client.get("/queries/suggestions")
  • The 'register' function registers tool handlers (including get_query_suggestions) with the FastMCP instance via @mcp.tool() decorator.
    def register(mcp: FastMCP, client: PiholeClient) -> int:
        @mcp.tool()
        async def get_query_log(
            length: int = 100,
            from_ts: int | None = None,
            until_ts: int | None = None,
            domain: str | None = None,
            client_ip: str | None = None,
            upstream: str | None = None,
            cursor: str | None = None,
        ) -> dict:
            """Fetch recent DNS queries with optional filters.
    
            Filters:
            - length: number of queries (default 100)
            - from_ts / until_ts: Unix timestamps
            - domain: exact or wildcard (*) domain match
            - client_ip: exact or wildcard (*) client IP match
            - upstream: one of 'cache', 'blocklist', 'permitted'
            - cursor: pagination cursor from previous response
            """
            params: dict = {"length": length}
            if from_ts is not None:
                params["from"] = from_ts
            if until_ts is not None:
                params["until"] = until_ts
            if domain:
                params["domain"] = domain
            if client_ip:
                params["client"] = client_ip
            if upstream:
                params["upstream"] = upstream
            if cursor:
                params["cursor"] = cursor
            return await client.get("/queries", params=params)
    
        @mcp.tool()
        async def get_query_suggestions() -> dict:
            """Get available filter values for the query log (domains, clients, upstreams, types, statuses)."""
            return await client.get("/queries/suggestions")
    
        return 2
  • The 'register_all' function iterates over modules including 'queries' and calls each module's register() function to register all tools with the MCP server.
    def register_all(mcp: FastMCP, client: PiholeClient) -> int:
        """Register every tool module against the FastMCP instance. Returns tool count."""
        count = 0
        for module in (stats, queries, blocking, domains, local_dns, maintenance):
            count += module.register(mcp, client)
        return count
Behavior3/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 states what the tool returns but does not disclose behavioral traits such as side effects (likely none), authentication requirements, or rate limits. For a simple read-only tool with no parameters, this is adequate but minimal.

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, well-structured sentence that front-loads the purpose. Every word is essential, with no redundancy.

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

Completeness5/5

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

Given zero parameters, no annotations, and an existing output schema, the description is complete enough. It explains what filter values are available without needing to detail return values.

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 input schema has zero parameters, and the description adds no parameter-specific information. Per guidelines, a baseline of 4 is appropriate when there are no parameters.

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 verb ('get'), resource ('filter values'), and specific categories (domains, clients, upstreams, types, statuses), distinguishing it from sibling tools like get_query_log.

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?

Usage context is implied by listing the filter categories, but there is no explicit guidance on when to use this tool versus alternatives, nor any examples of use cases.

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