Skip to main content
Glama

list_tickets

Retrieve user support tickets with optional status filtering to track and manage support requests within the FitSlot system.

Instructions

List all tickets for a user, optionally filtered by status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes
statusNo

Implementation Reference

  • The execute handler function for the list_tickets tool. Validates userId and optional status, fetches tickets via apiService.getTickets, formats response as JSON or error.
    execute: async (args: {
      userId: string;
      status?: string;
    }) => {
      try {
        logger.info('Listing tickets', args);
    
        validateNotEmpty(args.userId, 'User ID');
        if (args.status) {
          validateEnum(args.status, TicketStatus, 'Status');
        }
    
        const tickets = await apiService.getTickets(
          args.userId,
          args.status as TicketStatus | undefined
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  success: true,
                  count: tickets.length,
                  tickets: tickets.map(t => ({
                    id: t.id,
                    title: t.title,
                    status: t.status,
                    priority: t.priority,
                    createdAt: t.createdAt,
                    updatedAt: t.updatedAt
                  }))
                },
                null,
                2
              )
            }
          ]
        };
      } catch (error) {
        logger.error('Failed to list tickets', error);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  success: false,
                  error: error instanceof Error ? error.message : 'Unknown error'
                },
                null,
                2
              )
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema defining input parameters for list_tickets: required userId (string), optional status (enum of ticket statuses).
    parameters: z.object({
      userId: z.string().describe('ID of the user'),
      status: z.enum(['open', 'in_progress', 'resolved', 'closed']).optional().describe('Filter by ticket status')
    }),
  • src/index.ts:60-68 (registration)
    Creates the ticketTools object (containing list_tickets) via createTicketTools and spreads it into allTools, which is used by MCP server's ListTools and CallTool request handlers for tool registration and execution.
    const ticketTools = createTicketTools(apiService);
    const chatbotTools = createChatbotTools(chatbotService);
    const pdfTools = createPDFTools(pdfService);
    
    const allTools = {
      ...ticketTools,
      ...chatbotTools,
      ...pdfTools
    };
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool lists tickets but doesn't disclose behavioral traits such as whether it requires authentication, returns paginated results, has rate limits, or what happens if the user ID is invalid. This leaves significant gaps for an agent to understand how to use it effectively.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It front-loads the core purpose ('List all tickets for a user') and adds optional filtering as a concise modifier, making it easy to parse quickly.

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 no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It lacks details on authentication, error handling, return format, and usage context compared to siblings. For a tool with two parameters and no structured support, this minimal description doesn't provide enough information for reliable agent use.

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?

Schema description coverage is 0%, so the description must compensate. It mentions filtering by status, which aligns with the 'status' parameter, but doesn't explain the 'userId' parameter or provide additional context like format examples or constraints. This adds some value but doesn't fully cover the two parameters, resulting in a baseline score.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('tickets for a user'), making the purpose specific and understandable. However, it doesn't distinguish this tool from sibling tools like 'get_ticket' or 'search_faqs' that might also retrieve ticket information, which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_ticket' (for a single ticket) or 'search_faqs' (for FAQs). It mentions optional filtering by status but doesn't explain when this filtering is appropriate or what happens without it.

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

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/osmarsant/fitslot-mcp'

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