MCP tool: get_tickets_analytics_by_time

Get aggregated ticket analytics data grouped by time periods (daily, weekly, monthly, quarterly) for a specific date range.

Example prompt

Get ticket analytics by time for the last quarter with monthly granularity

Parameters

ParameterTypeRequiredDescription
dateRangeobjectYesInclusive date range to aggregate over
dateRange.startDatestringYesStart date in YYYY-MM-DD format
dateRange.endDatestringYesEnd date in YYYY-MM-DD format
timeGranularitystringYesTime granularity: daily, weekly, monthly, or quarterly
teamIdsarrayNoOptional array of team IDs to filter by
includeArchivedTicketsbooleanNoInclude archived tickets (default: false)
includeTicketMetadatabooleanNoInclude minimal ticket metadata for drill-down (default: false)
metadataPagenumberNoPage number for metadata pagination (1-based, only used when includeTicketMetadata is true)
metadataLimitnumberNoLimit for metadata results per page (max 200, only used when includeTicketMetadata is true)

Time granularity options

  • daily - Group data by day
  • weekly - Group data by week
  • monthly - Group data by month
  • quarterly - Group data by quarter

Response fields

The response will contain aggregated analytics data with the following structure:
FieldTypeDescription
aggregationTypestringType of aggregation performed (“time”)
totalTicketsnumberTotal number of tickets in the date range
totalFoundnumberTotal number of tickets found matching criteria
dateRangeobjectThe date range used for the analysis
includeArchivedTicketsbooleanWhether archived tickets were included
includeTicketMetadatabooleanWhether ticket metadata was included
summaryobjectSummary statistics across all time periods
aggregatedDataarrayArray of team-based analytics objects with time breakdowns

Summary object fields

The summary object contains:
FieldTypeDescription
avgTicketsPerPeriodnumberAverage number of tickets per time period
peakPeriodstringTime period with the highest ticket count
peakTicketCountnumberNumber of tickets in the peak period
lowestPeriodstringTime period with the lowest ticket count
lowestTicketCountnumberNumber of tickets in the lowest period

Team analytics object fields

Each team in the aggregatedData array contains:
FieldTypeDescription
teamIdstringTeam unique identifier
teamNamestringTeam name
totalnumberTotal number of tickets for this team
percentagenumberPercentage of total tickets
timeBreakdownobjectBreakdown by time periods with detailed metrics

Time period breakdown fields

Each time period in the timeBreakdown object contains:
FieldTypeDescription
periodstringThe time period identifier (e.g., “2025-08-13”)
periodStartstringStart timestamp of the time period
periodEndstringEnd timestamp of the time period
ticketCountnumberNumber of tickets in this time period
createdCountnumberNumber of tickets created in this time period
statusBreakdownobjectBreakdown by ticket status with counts and percentages
priorityBreakdownobjectBreakdown by ticket priority with counts and percentages
assigneeBreakdownobjectBreakdown by assignee with counts and percentages
sourceBreakdownobjectBreakdown by ticket source

Sample response

{
  "aggregationType": "time",
  "totalTickets": 2,
  "totalFound": 2,
  "dateRange": {
    "startDate": "2025-01-01",
    "endDate": "2025-09-16"
  },
  "includeArchivedTickets": false,
  "includeTicketMetadata": false,
  "summary": {
    "avgTicketsPerPeriod": 1,
    "peakPeriod": "2025-08-13",
    "peakTicketCount": 1,
    "lowestPeriod": "2025-08-13",
    "lowestTicketCount": 1
  },
  "aggregatedData": [
    {
      "teamId": "THEVVHPCCER33E",
      "teamName": "Engineering",
      "total": 2,
      "percentage": 100,
      "timeBreakdown": {
        "2025-08-13": {
          "period": "2025-08-13",
          "periodStart": "2025-08-13T00:00:00.000Z",
          "periodEnd": "2025-08-14T00:00:00.000Z",
          "ticketCount": 1,
          "createdCount": 1,
          "statusBreakdown": {
            "Open": {
              "count": 1,
              "percentage": 100,
              "statusId": "3SC6BH2K10X5BSCXF2MFWVYZVYNFX"
            }
          },
          "priorityBreakdown": {
            "Urgent": {
              "count": 1,
              "percentage": 100,
              "priorityId": "CSC6BH2K100SATQR0ZS6KHBW1DFPK"
            }
          },
          "assigneeBreakdown": {
            "John Doe": {
              "count": 1,
              "percentage": 100,
              "assigneeId": "UTHOOQNUUXZQQ3",
              "assigneeEmail": "john.doe@thena.ai"
            }
          },
          "sourceBreakdown": {
            "manual": 1
          }
        },
        "2025-08-20": {
          "period": "2025-08-20",
          "periodStart": "2025-08-20T00:00:00.000Z",
          "periodEnd": "2025-08-21T00:00:00.000Z",
          "ticketCount": 1,
          "createdCount": 1,
          "statusBreakdown": {
            "Open": {
              "count": 1,
              "percentage": 100,
              "statusId": "3SC6BH2K10X5BSCXF2MFWVYZVYNFX"
            }
          },
          "priorityBreakdown": {
            "Medium": {
              "count": 1,
              "percentage": 100,
              "priorityId": "CSC6BH2K10XR2ZVVY84VV8506YN80"
            }
          },
          "assigneeBreakdown": {
            "John Doe": {
              "count": 1,
              "percentage": 100,
              "assigneeId": "UTHOOQNUUXZQQ3",
              "assigneeEmail": "john.doe@thena.ai"
            }
          },
          "sourceBreakdown": {
            "manual": 1
          }
        }
      }
    }
  ]
}