Skip to main content
Glama

get_ticket_details

Retrieve detailed information for a specific Autotask ticket using its ID to access comprehensive ticket data when full details are required.

Instructions

Get detailed information for a specific ticket by ID. Use this for full ticket data when needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullDetailsNoWhether to return full ticket details (default: false for optimized data)
ticketIDYesTicket ID to retrieve

Implementation Reference

  • Main handler implementation: Fetches detailed ticket information from Autotask API using client.tickets.get(id), optionally applies data optimization.
    async getTicket(id: number, fullDetails: boolean = false): Promise<AutotaskTicket | null> { const client = await this.ensureClient(); try { this.logger.debug(`Getting ticket with ID: ${id}, fullDetails: ${fullDetails}`); const result = await client.tickets.get(id); const ticket = result.data as AutotaskTicket; if (!ticket) { return null; } // Apply optimization unless full details requested return fullDetails ? ticket : this.optimizeTicketData(ticket); } catch (error) { this.logger.error(`Failed to get ticket ${id}:`, error); throw error; } }
  • MCP tool handler dispatch: Receives tool call and delegates to AutotaskService.getTicket().
    case 'get_ticket_details': result = await this.autotaskService.getTicket(args.ticketID, args.fullDetails); message = `Ticket details retrieved successfully`; break;
  • Tool schema definition and registration in listTools(): Defines input schema (ticketID required, optional fullDetails) and description.
    name: 'get_ticket_details', description: 'Get detailed information for a specific ticket by ID. Use this for full ticket data when needed.', inputSchema: { type: 'object', properties: { ticketID: { type: 'number', description: 'Ticket ID to retrieve' }, fullDetails: { type: 'boolean', description: 'Whether to return full ticket details (default: false for optimized data)', default: false } }, required: ['ticketID'] } },
  • Helper function: Optimizes ticket data by truncating large text fields (used when fullDetails=false).
    private optimizeTicketData(ticket: AutotaskTicket): AutotaskTicket { const maxDescriptionLength = 500; const maxNotesLength = 300; return { ...ticket, // Truncate description if too long description: ticket.description && ticket.description.length > maxDescriptionLength ? ticket.description.substring(0, maxDescriptionLength) + '... [truncated]' : ticket.description, // Remove or truncate potentially large fields resolution: ticket.resolution && ticket.resolution.length > maxNotesLength ? ticket.resolution.substring(0, maxNotesLength) + '... [truncated]' : ticket.resolution, // Remove arrays that might contain large amounts of data userDefinedFields: [], // Keep only essential custom fields, truncate if present ...(ticket.purchaseOrderNumber && { purchaseOrderNumber: ticket.purchaseOrderNumber.length > 50 ? ticket.purchaseOrderNumber.substring(0, 50) + '...' : ticket.purchaseOrderNumber }) }; }

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