# Get analytics summary (`get_analytics_summary`)

Returns aggregate trading totals for the connected Store over a reporting period of 7, 30, 90 or 365 complete UTC days: order count, product count, and revenue in integer minor units broken down by currency. It is a pre-aggregated summary rather than an event export, so the response size does not grow with traffic, and it contains no customer personal data. It requires the analytics:read scope and has no side effects.

- Source URL: https://www.signcustomiser.com/help/mcp/tools/get_analytics_summary/
- Markdown URL: https://www.signcustomiser.com/help/mcp/tools/get_analytics_summary.md
- MCP endpoint: https://web.signcustomiser.com/mcp
- Required scope: `analytics:read`
- Behaviour: read

## Purpose

Answer "how is the store doing" without reading orders one by one.

## Annotations

| Hint | Value |
| --- | --- |
| readOnlyHint | true |
| destructiveHint | false |
| idempotentHint | true |
| openWorldHint | false |

## Prerequisites

- A merchant has connected this store and approved the analytics:read scope.

## Arguments

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | string | no | How many complete UTC days to report over. Defaults to 30d. This set is closed. One of: `7d`, `30d`, `90d`, `365d`. |
| `end_date` | string | no | The inclusive final UTC day, as YYYY-MM-DD. It must be before the current UTC date and defaults to yesterday. |

## Result

One summary covering complete UTC days, with the half-open query bounds it used. Revenue is one row per currency; rows are never converted or summed across currencies, and historical rows with an unusable stored currency appear honestly in a null-currency row.

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `request_id` | string | yes |  |
| `store` | object | yes |  |
| `store.id` | integer | yes |  |
| `store.name` | string | yes |  |
| `period` | string | yes | One of: `7d`, `30d`, `90d`, `365d`. |
| `starts_at` | string | yes | The inclusive start of the reported window, UTC. |
| `ends_before` | string | yes | The exclusive end of the reported window, UTC. |
| `order_count` | integer | yes |  |
| `product_count` | integer | yes |  |
| `revenue` | array of object | yes | One row per currency. Amounts are never converted or added across rows. |
| `revenue[].currency` | string or null | no | ISO 4217, or null for historical rows whose stored currency is unusable. |
| `revenue[].amount` | integer | yes | Integer minor units of currency. |
| `revenue[].order_count` | integer | yes |  |

## Error cases

| Code | Recovery |
| --- | --- |
| `insufficient_scope` | The connection was approved without analytics:read. |
| `invalid_parameter` | period is not one of the four supported windows, or end_date is not a UTC YYYY-MM-DD date before today. |

## Example: The last 30 complete days

Request:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_analytics_summary",
    "arguments": {
      "period": "30d"
    }
  }
}
```

Response:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "structuredContent": {
      "request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t",
      "store": {
        "id": 12,
        "name": "Demo Signs"
      },
      "period": "30d",
      "starts_at": "2026-06-20T00:00:00Z",
      "ends_before": "2026-07-20T00:00:00Z",
      "order_count": 18,
      "product_count": 21,
      "revenue": [
        {
          "currency": "AUD",
          "amount": 248900,
          "order_count": 16
        },
        {
          "currency": "NZD",
          "amount": 31100,
          "order_count": 2
        }
      ]
    }
  }
}
```

## Example: A reporting period that does not exist (error)

Request:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_analytics_summary",
    "arguments": {
      "period": "14d"
    }
  }
}
```

Response:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "isError": true,
    "structuredContent": {
      "error": {
        "code": "invalid_parameter",
        "title": "Invalid query parameter",
        "detail": "The period parameter must be one of: 7d, 30d, 90d, 365d.",
        "recovery": "Correct the parameter named in parameter. Dates are YYYY-MM-DD in UTC and identifiers are integers between 1 and 2147483647.",
        "parameter": "period",
        "allowed_values": [
          "7d",
          "30d",
          "90d",
          "365d"
        ]
      }
    }
  }
}
```
