Home / Servers / Cloudflare API / art_analytics_query_top_n

Query analytics top-N

An MCP tool from the Cloudflare API server, hosted on mcp.hjlabs.in.

Query analytics top-N Returns the top N results for a dataset by a specified stat. Includes an array of result rows… [POST /accounts/{account_id}/analytics/query/{dataset}/top-n]

Name on the gateway: cloudflare_api__art_analytics_query_top_n · may change things.

Parameters

NameTypeDescription
account_id requiredstringaccount_id parameter
dataset requiredstringdataset parameter
filters requiredarrayFilters to apply before aggregating results.
from requiredstringThe start of the query time range (inclusive).…
groupBy requiredarraySpecifies the column names to group results by.…
stats requiredarraySpecifies the stat names to include in results.…
to requiredstringSpecifies the end of the query time range…
n requiredintegerMaximum number of results to return.
orderBy requiredstringSpecifies the stat name for sorting results in…

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "cloudflare_api__art_analytics_query_top_n",
  "arguments": {
    "account_id": "…",
    "dataset": "…",
    "filters": [],
    "from": "…",
    "groupBy": [],
    "stats": [],
    "to": "…",
    "n": 0,
    "orderBy": "…"
  }
}

Or connect the Cloudflare API server directly, which lists 3,127 tools including this one:

Run in your terminal
claude mcp add --transport http hj-cloudflare-api https://mcp.hjlabs.in/mcp/cloudflare-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the query analytics top-n tool with account_id set to ….

More from Cloudflare API