Skip to main content
Glama

create_ticket

Create new support tickets in Autotask to track customer issues, assign resources, and manage service requests with required company details and descriptions.

Instructions

Create a new ticket in Autotask

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assignedResourceIDNoAssigned resource ID
companyIDYesCompany ID for the ticket
contactIDNoContact ID for the ticket
descriptionYesTicket description
priorityNoTicket priority ID
statusNoTicket status ID
titleYesTicket title

Implementation Reference

  • MCP tool handler execution logic for 'create_ticket': dispatches to autotaskService.createTicket(args)
    case 'create_ticket': result = await this.autotaskService.createTicket(args); message = `Successfully created ticket with ID: ${result}`; break;
  • Input schema and metadata definition for the create_ticket tool, returned by listTools()
    name: 'create_ticket', description: 'Create a new ticket in Autotask', inputSchema: { type: 'object', properties: { companyID: { type: 'number', description: 'Company ID for the ticket' }, title: { type: 'string', description: 'Ticket title' }, description: { type: 'string', description: 'Ticket description' }, status: { type: 'number', description: 'Ticket status ID' }, priority: { type: 'number', description: 'Ticket priority ID' }, assignedResourceID: { type: 'number', description: 'Assigned resource ID' }, contactID: { type: 'number', description: 'Contact ID for the ticket' } }, required: ['companyID', 'title', 'description'] } },
  • Core helper method implementing ticket creation via AutotaskClient API
    async createTicket(ticket: Partial<AutotaskTicket>): Promise<number> { const client = await this.ensureClient(); try { this.logger.debug('Creating ticket:', ticket); const result = await client.tickets.create(ticket as any); const ticketId = (result.data as any)?.id; this.logger.info(`Ticket created with ID: ${ticketId}`); return ticketId; } catch (error) { this.logger.error('Failed to create ticket:', error); throw error; } }
  • MCP server registration of CallToolRequestSchema handler that invokes toolHandler.callTool for create_ticket execution
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => { try { this.logger.debug(`Handling tool call: ${request.params.name}`); const result = await this.toolHandler.callTool( request.params.name, request.params.arguments || {} ); return { content: result.content, isError: result.isError }; } catch (error) { this.logger.error(`Failed to call tool ${request.params.name}:`, error); throw new McpError( ErrorCode.InternalError, `Failed to call tool: ${error instanceof Error ? error.message : 'Unknown error'}` ); } });
  • MCP server registration of ListToolsRequestSchema handler that returns tool list including create_ticket definition
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { try { this.logger.debug('Handling list tools request'); const tools = await this.toolHandler.listTools(); return { tools }; } catch (error) { this.logger.error('Failed to list tools:', error); throw new McpError( ErrorCode.InternalError, `Failed to list tools: ${error instanceof Error ? error.message : 'Unknown error'}` ); } });

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/asachs01/autotask-mcp'

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