Skip to main content
Glama

create_ticket

Submit support requests to FitSlot by creating tickets with title, description, priority level, and user identification for issue resolution.

Instructions

Create a new support ticket in the FitSlot system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
descriptionYes
priorityYes
userIdYes

Implementation Reference

  • Full implementation of the 'create_ticket' MCP tool, including description, Zod input schema, and execute handler that performs validation and delegates to the API service.
    create_ticket: {
      description: 'Create a new support ticket in the FitSlot system',
      parameters: z.object({
        title: z.string().describe('Title of the ticket'),
        description: z.string().describe('Detailed description of the issue or request'),
        priority: z.enum(['low', 'medium', 'high', 'urgent']).describe('Priority level of the ticket'),
        userId: z.string().describe('ID of the user creating the ticket')
      }),
      execute: async (args: {
        title: string;
        description: string;
        priority: string;
        userId: string;
      }) => {
        try {
          logger.info('Creating new ticket', args);
    
          // Validate inputs
          validateNotEmpty(args.title, 'Title');
          validateNotEmpty(args.description, 'Description');
          validateNotEmpty(args.userId, 'User ID');
          validateEnum(args.priority, TicketPriority, 'Priority');
    
          const ticket = await apiService.createTicket({
            title: args.title,
            description: args.description,
            priority: args.priority as TicketPriority,
            userId: args.userId
          });
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(
                  {
                    success: true,
                    message: 'Ticket created successfully',
                    ticket: {
                      id: ticket.id,
                      title: ticket.title,
                      status: ticket.status,
                      priority: ticket.priority,
                      createdAt: ticket.createdAt
                    }
                  },
                  null,
                  2
                )
              }
            ]
          };
        } catch (error) {
          logger.error('Failed to create ticket', error);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(
                  {
                    success: false,
                    error: error instanceof Error ? error.message : 'Unknown error'
                  },
                  null,
                  2
                )
              }
            ],
            isError: true
          };
        }
      }
    },
  • src/index.ts:60-68 (registration)
    Registration of the ticket tools (including create_ticket) into the allTools object, which is used by the MCP server's ListTools and CallTool request handlers.
    const ticketTools = createTicketTools(apiService);
    const chatbotTools = createChatbotTools(chatbotService);
    const pdfTools = createPDFTools(pdfService);
    
    const allTools = {
      ...ticketTools,
      ...chatbotTools,
      ...pdfTools
    };
  • Helper method in FitSlotAPIService that handles the actual HTTP POST request to create a ticket on the backend API.
    async createTicket(request: CreateTicketRequest): Promise<Ticket> {
      try {
        const response = await this.client.post<Ticket>('/api/tickets', request);
        logger.info('Ticket created successfully', { ticketId: response.data.id });
        return response.data;
      } catch (error) {
        logger.error('Failed to create ticket', error);
        throw error;
      }
    }
  • TypeScript interface defining the request shape for creating a ticket, used by the API service and tool handler.
    export interface CreateTicketRequest {
      title: string;
      description: string;
      priority: TicketPriority;
      userId: string;
    }
  • Enum defining valid priority values for tickets, used in schema validation.
    export enum TicketPriority {
      LOW = 'low',
      MEDIUM = 'medium',
      HIGH = 'high',
      URGENT = 'urgent'
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. It states 'Create a new support ticket,' implying a write/mutation operation, but doesn't disclose behavioral traits like whether it requires authentication, what happens on success (e.g., returns a ticket ID), error conditions, or side effects. This is a significant gap for a mutation tool with zero annotation coverage.

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 no wasted words, clearly front-loading the core action. It's appropriately sized for the tool's purpose, making it easy to parse quickly without unnecessary elaboration.

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 complexity of a mutation tool with 4 required parameters, no annotations, and no output schema, the description is incomplete. It lacks crucial details like behavioral context, parameter meanings, and expected outcomes, making it inadequate for an AI agent to use the tool effectively without additional assumptions.

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

Parameters1/5

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

Schema description coverage is 0%, meaning the schema provides no descriptions for parameters. The description adds no information about what the parameters mean beyond their names, failing to compensate for the coverage gap. For example, it doesn't explain what 'priority' levels entail or how 'userId' is obtained, leaving parameters undocumented.

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 action ('Create a new support ticket') and the target system ('FitSlot system'), which is specific and unambiguous. It distinguishes from siblings like 'close_ticket' or 'update_ticket' by focusing on creation. However, it doesn't specify what a 'support ticket' entails beyond the basic concept, leaving some ambiguity about the resource's nature.

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 'ask_support' (which might be for queries) or 'update_ticket' (for modifications). It lacks context about prerequisites, such as whether the user must be authenticated or have specific permissions, or when creation is appropriate versus other actions.

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