Get Site Analytics
get_analyticsUse this when the user asks about traffic, visitors, or which pages/referrers are performing on their PUBLISHED site. Backed by the same analytics as the Kleap dashboard's Visitors view. Returns zeroed data with configured:false if the app has never been published (analytics is set up automatically on publish). Requires the analytics:read scope — sessions connected BEFORE this tool shipped don't have it: on INSUFFICIENT_SCOPE the connection has NOT expired: it was authorized before this tool existed and needs one re-authorization to add the scope. Say that, never that it expired.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"app_id": "<app_id>",
"context": "<context>"
},
"name": "get_analytics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | The app id to fetch analytics for | |
| period | No | Time window: '7d' (default), '30d', or '90d' | |
| context | Yes | Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | No | ||
| period | No | ||
| visitors | No | ||
| pageviews | No | ||
| referrers | No | ||
| top_pages | No | ||
| configured | No |