Skip to main content
Glama

get_stats

Retrieve and analyze ticket statistics from mcptix by grouping data based on status or priority to track and manage project tasks effectively.

Instructions

Get statistics about tickets in the system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_byNoField to group bystatus

Implementation Reference

  • The main execution function for the 'get_stats' tool. It fetches tickets, groups them by the specified field (status or priority), counts occurrences, and returns the statistics.
    export function handleGetStats(ticketQueries: TicketQueries, args: any): ToolResponse { const groupBy = args.group_by || 'status'; // Get all tickets const tickets = ticketQueries.getTickets({}, 'updated', 'desc', 1000, 0); // Group tickets by the specified field const stats: Record<string, number> = {}; for (const ticket of tickets) { const key = ticket[groupBy as keyof Ticket] as string; stats[key] = (stats[key] || 0) + 1; } return createSuccessResponse(stats); }
  • The input schema definition for the 'get_stats' tool, specifying optional 'group_by' parameter with enum ['status', 'priority']. Included in toolSchemas array for MCP tool listing.
    { name: 'get_stats', description: 'Get statistics about tickets in the system', inputSchema: { type: 'object', properties: { group_by: { type: 'string', description: 'Field to group by', enum: ['status', 'priority'], default: 'status', }, }, }, },
  • Registration of the 'get_stats' tool handler in the switch statement that dispatches tool calls to their respective handlers.
    case 'get_stats': return handleGetStats(ticketQueries, args);
  • Import of the 'get_stats' handler function into the setup module.
    import { handleGetStats } from './handlers/get-stats';

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ownlytics/mcptix'

If you have feedback or need assistance with the MCP directory API, please join our Discord server