search_ticket_notes
Search and retrieve notes associated with a specific Autotask ticket to track activity history and communication details.
Instructions
Search for notes on a specific ticket
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageSize | No | Number of results to return (default: 25, max: 100) | |
| ticketId | Yes | The ticket ID to search notes for |
Implementation Reference
- Core implementation of searchTicketNotes: queries Autotask notes.list API filtered by ticketId, with configurable pageSize.async searchTicketNotes(ticketId: number, options: AutotaskQueryOptionsExtended = {}): Promise<AutotaskTicketNote[]> { const client = await this.ensureClient(); try { this.logger.debug(`Searching ticket notes for ticket ${ticketId}:`, options); // Set reasonable limits for notes const optimizedOptions = { filter: [ { field: 'ticketId', op: 'eq', value: ticketId } ], pageSize: options.pageSize || 25 }; const result = await client.notes.list(optimizedOptions); const notes = (result.data as any[]) || []; this.logger.info(`Retrieved ${notes.length} ticket notes`); return notes as AutotaskTicketNote[]; } catch (error) { this.logger.error(`Failed to search ticket notes for ticket ${ticketId}:`, error); throw error; } }
- src/handlers/tool.handler.ts:502-521 (schema)Input schema definition for the search_ticket_notes tool, specifying ticketId (required) and optional pageSize.{ name: 'search_ticket_notes', description: 'Search for notes on a specific ticket', inputSchema: { type: 'object', properties: { ticketId: { type: 'number', description: 'The ticket ID to search notes for' }, pageSize: { type: 'number', description: 'Number of results to return (default: 25, max: 100)', minimum: 1, maximum: 100 } }, required: ['ticketId'] } },
- src/handlers/tool.handler.ts:502-521 (registration)Tool registration in listTools(): defines name, description, and inputSchema for MCP tool listing.{ name: 'search_ticket_notes', description: 'Search for notes on a specific ticket', inputSchema: { type: 'object', properties: { ticketId: { type: 'number', description: 'The ticket ID to search notes for' }, pageSize: { type: 'number', description: 'Number of results to return (default: 25, max: 100)', minimum: 1, maximum: 100 } }, required: ['ticketId'] } },
- src/handlers/tool.handler.ts:1179-1182 (handler)Dispatch handler in callTool switch: extracts args and delegates to autotaskService.searchTicketNotes.case 'search_ticket_notes': result = await this.autotaskService.searchTicketNotes(args.ticketId, { pageSize: args.pageSize }); message = `Found ${result.length} ticket notes`; break;