You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a new MCP tool and service method for uploading file attachments
to Autotask tickets via POST /Tickets/{id}/Attachments. File content
is accepted as a base64-encoded string (MCP is JSON-RPC, so binary
bytes must be base64-encoded).
The service method validates the base64 input and enforces Autotask's
3 MB hard limit on ticket attachments locally, returning a clear error
instead of a cryptic 400 from the API. API validation errors are
surfaced using the same pattern as #32.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
'Upload a file attachment to an existing ticket. The file content must be passed as a base64-encoded string in the `data` field (MCP is JSON-RPC, so binary bytes must be base64-encoded). Autotask enforces a 3 MB hard limit on ticket attachments; this tool validates the decoded size before calling the API and returns a clear error if the limit is exceeded. Example: { ticketId: 12345, title: "screenshot.png", data: "iVBORw0KGgoAAAANSUhEUgAA..." }',
1281
+
inputSchema: {
1282
+
type: 'object',
1283
+
properties: {
1284
+
ticketId: {
1285
+
type: 'number',
1286
+
description: 'The ticket ID to attach the file to'
1287
+
},
1288
+
title: {
1289
+
type: 'string',
1290
+
description: 'Display title for the attachment (typically the filename, e.g. "screenshot.png")'
1291
+
},
1292
+
data: {
1293
+
type: 'string',
1294
+
description:
1295
+
'Base64-encoded file content. Maximum decoded size: 3 MB (Autotask ticket attachment limit). Example: read a file and pass its base64 representation here.'
1296
+
},
1297
+
fullPath: {
1298
+
type: 'string',
1299
+
description: 'Original filename including any path. Defaults to `title` if not provided.'
1300
+
},
1301
+
contentType: {
1302
+
type: 'string',
1303
+
description: 'MIME type of the file (e.g. "image/png", "application/pdf"). Optional.'
thrownewError('createTicketAttachment: `data` is not valid base64-encoded content');
1550
+
}
1551
+
1552
+
if(decodedLength===0){
1553
+
thrownewError('createTicketAttachment: decoded attachment is empty');
1554
+
}
1555
+
if(decodedLength>MAX_ATTACHMENT_BYTES){
1556
+
thrownewError(
1557
+
`createTicketAttachment: attachment is ${decodedLength} bytes which exceeds the Autotask 3MB (${MAX_ATTACHMENT_BYTES} byte) limit for ticket attachments`
0 commit comments