> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zapnito.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Metric tools

> Tools for listing the aggregate metrics available for your Zapnito community and reading the value of a single metric.

Use these tools to answer aggregate questions, such as how many members your community has or how active it is. Don't page through `list` tools to count records. For every tool at a glance, see [All MCP tools](https://docs.zapnito.com/mcp/tools/all.md). For how the tools work together, see the [MCP overview](https://docs.zapnito.com/mcp/overview.md#how-the-tools-work).

Metrics work differently from the other tools. There is no `search` tool, and `zapnito_list_metrics` isn't paginated. Call [List metrics](#list-metrics) first to see what's available, then call [Get a metric](#get-a-metric) for the value you want.

## List metrics

`zapnito_list_metrics`

Lists the aggregate metrics available for your community. Each metric has a `key`, a description, a category, a `unit` and a `time_scope`. Call this before [Get a metric](#get-a-metric).

**category** `string`

Only list metrics in this category. Accepts `members`, `content`, `discussions` or `comments`. Omit to list all metrics.

```json title="Arguments" theme={null}
{
  "category": "members"
}
```

Example prompt: "Which member metrics can you report on?"

## Get a metric

`zapnito_get_metric`

Returns the value of one aggregate metric for your community, such as `members_total` or `members_active`.

**metric** `string` *required*

The key of the metric, as returned by [List metrics](#list-metrics). One of `comments_published`, `comments_total`, `contents_published`, `contents_total`, `discussions_published`, `discussions_total`, `members_active`, `members_new` or `members_total`.

**period** `string`

A named time window. Accepts `last_7_days`, `last_30_days`, `last_90_days`, `last_365_days`, `this_month`, `last_month` or `this_year`. The `last_N_days`, `this_month` and `this_year` windows end now. `last_month` is the previous full calendar month. Defaults to `last_30_days` when you give neither `period` nor `from` and `to`.

**from** `string`

The first day of a custom range, inclusive, in `YYYY-MM-DD` format (UTC). Use with `to`.

**to** `string`

The last day of a custom range, inclusive, in `YYYY-MM-DD` format (UTC). Must be today or earlier. Use with `from`.

> [!WARNING]
>
> Use either `period` or `from` and `to`, never both. The tool rejects all three for a metric with a `current` time scope.

```json title="Named period" theme={null}
{
  "metric": "members_new",
  "period": "last_month"
}
```

```json title="Custom range" theme={null}
{
  "metric": "discussions_published",
  "from": "2026-01-01",
  "to": "2026-03-31"
}
```

Example prompt: "How many new members joined our community last month?"

## Time scope

A metric's `time_scope` decides which time ranges you can ask for.

| Time scope | Accepts | Notes |
| - | - | - |
| `current` | No `period`, `from` or `to`. | The value right now. There is no history, so passing a range is an error. |
| `ending_now` | Only ranges that run up to now, such as `last_30_days` or `this_month`. | `from` and `to` are accepted only when `to` is today. Past ranges, such as `last_month`, are an error. |
| `historical` | Any `period`, or any `from` and `to` dates. | Includes past ranges, such as `last_month`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.