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';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get statistics', which implies a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns aggregated data, or details about output format. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that efficiently states the tool's purpose without unnecessary words. However, it could be more front-loaded with key details like the aggregation aspect, but it's appropriately sized for its limited content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's purpose (statistics retrieval) and lack of annotations and output schema, the description is incomplete. It doesn't explain what statistics are returned, in what format, or any behavioral traits like data freshness or access requirements. For a tool with no structured support, more descriptive context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the 'group_by' parameter with enum values. The description doesn't add any meaning beyond the schema, as it doesn't mention parameters at all. With high schema coverage, the baseline score of 3 is appropriate since the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Get statistics about tickets in the system', which provides a basic purpose (verb+resource) but lacks specificity about what kind of statistics or scope. It doesn't distinguish from sibling tools like 'list_tickets' or 'search_tickets' that also retrieve ticket information, making it somewhat vague.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'list_tickets' or 'search_tickets'. The description implies it's for aggregated statistics, but it doesn't explicitly state this or mention prerequisites, leaving the agent to infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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