---
title: "Get MCP activity stats"
method: GET
path: "/api/v1/aiAgents/admin/mcp-activity/stats"
---

# Get MCP activity stats

`GET /api/v1/aiAgents/admin/mcp-activity/stats`

Get aggregated MCP tool call stats for admin

## Query parameters

- `projectUuids` string[]
- `userUuids` string[]
- `agentUuids` string[]
- `toolNames` string[]
- `clientNames` string[]
- `dateFrom` string
- `dateTo` string

## Response `200`

Success

- ApiMcpActivityStatsResponse
  - `results` McpActivityStats, required
    - `recentErrors` McpActivityItem[], required
      - `sessionGroup` McpActivitySessionGroup, required — Server-computed display group for session-grouped activity: a session split into segments on 1h inactivity gaps (sessionless calls chunk the same way under a shared no-session block). Counts cover the whole segment, not just the loaded page. Null when the query isn't session-grouped (e.g. sorted by duration).
        - `errorCount` number, double, required
        - `callCount` number, double, required
        - `key` string, required
      - `sessionId` string, nullable, required
      - `protocolVersion` string, nullable, required
      - `authType` string, required
      - `userAgent` string, nullable, required
      - `clientVersion` string, nullable, required
      - `clientName` string, nullable, required
      - `durationMs` number, double, required
      - `errorMessage` string, nullable, required
      - `status` 'success' | 'error', required
      - `toolArgs` RecordStringUnknown, required — Construct a type with a set of properties K of type T
      - `toolName` string, required
      - `agent` object, nullable, required
        - `name` string, required
        - `uuid` string, required
      - `project` object, nullable, required
        - `name` string, required
        - `uuid` string, required
      - `user` object, required
        - `email` string, nullable, required
        - `name` string, required
        - `uuid` string, required
      - `createdAt` string, required
      - `uuid` string, required
    - `agents` McpActivityAgentCount[], required
      - `count` number, double, required
      - `agent` object, nullable, required
        - `name` string, required
        - `uuid` string, required
    - `topTools` McpActivityToolCount[], required
      - `count` number, double, required
      - `toolName` string, required
    - `errorCalls` number, double, required
    - `totalCalls` number, double, required
  - `status` 'ok', required

## Other responses

- `default` — Error

---

[API](https://skmtc.net/lightdash/apis/lightdash-api.md) · [All operations](https://skmtc.net/lightdash/apis/lightdash-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lightdash/lightdash-api/versions/40c933755c9a/schema)
