Skip to main content
Glama

search_ticket_attachments

Find and retrieve attachments associated with a specific support ticket by searching through ticket documents and files.

Instructions

Search for attachments on a specific ticket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageSizeNoNumber of results to return (default: 10, max: 50)
ticketIdYesThe ticket ID to search attachments for

Implementation Reference

  • Main handler function that executes the core logic: queries Autotask attachments API filtered by parentId (ticket ID), with optional pagination.
    async searchTicketAttachments(ticketId: number, options: AutotaskQueryOptionsExtended = {}): Promise<AutotaskTicketAttachment[]> { const client = await this.ensureClient(); try { this.logger.debug(`Searching ticket attachments for ticket ${ticketId}:`, options); const optimizedOptions = { filter: [ { field: 'parentId', op: 'eq', value: ticketId } ], pageSize: options.pageSize || 10 }; const result = await client.attachments.list(optimizedOptions); const attachments = (result.data as any[]) || []; this.logger.info(`Retrieved ${attachments.length} ticket attachments`); return attachments as AutotaskTicketAttachment[]; } catch (error) { this.logger.error(`Failed to search ticket attachments for ticket ${ticketId}:`, error); throw error; } }
  • JSON schema definition for tool inputs: requires ticketId, optional pageSize.
    { name: 'search_ticket_attachments', description: 'Search for attachments on a specific ticket', inputSchema: { type: 'object', properties: { ticketId: { type: 'number', description: 'The ticket ID to search attachments for' }, pageSize: { type: 'number', description: 'Number of results to return (default: 10, max: 50)', minimum: 1, maximum: 50 } }, required: ['ticketId'] } },
  • Tool registration in listTools() method which returns all available MCP tools including this one.
    { name: 'search_ticket_attachments', description: 'Search for attachments on a specific ticket', inputSchema: { type: 'object', properties: { ticketId: { type: 'number', description: 'The ticket ID to search attachments for' }, pageSize: { type: 'number', description: 'Number of results to return (default: 10, max: 50)', minimum: 1, maximum: 50 } }, required: ['ticketId'] } },
  • MCP tool handler dispatch case that calls the service method and formats the result.
    case 'search_ticket_attachments': result = await this.autotaskService.searchTicketAttachments(args.ticketId, { pageSize: args.pageSize }); message = `Found ${result.length} ticket attachments`; break;

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