update_ticket
Modify Zendesk support tickets by updating subject, priority, status, assignee, comments, tags, or type to manage customer issues.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Ticket ID to update | |
| subject | No | Updated ticket subject | |
| comment | No | Internal (non-public) comment to add | |
| priority | No | Updated ticket priority | |
| status | No | Updated ticket status | |
| assignee_id | No | User ID of the new assignee | |
| group_id | No | New group ID for the ticket | |
| type | No | Updated ticket type | |
| tags | No | Updated tags for the ticket |
Implementation Reference
- src/tools/tickets.js:172-222 (handler)The primary handler function implementing the 'update_ticket' tool logic. It prepares the ticket update data (conditionally including fields and ensuring internal comments) and calls the zendeskClient to perform the update.handler: async ({ id, subject, comment, priority, status, assignee_id, group_id, type, tags, }) => { try { const ticketData = {}; if (subject !== undefined) ticketData.subject = subject; if (comment !== undefined) { ticketData.comment = { body: comment, public: false, // Always internal }; } if (priority !== undefined) ticketData.priority = priority; if (status !== undefined) ticketData.status = status; if (assignee_id !== undefined) ticketData.assignee_id = assignee_id; if (group_id !== undefined) ticketData.group_id = group_id; if (type !== undefined) ticketData.type = type; if (tags !== undefined) ticketData.tags = tags; const result = await zendeskClient.updateTicket(id, ticketData); return { content: [ { type: "text", text: `Ticket updated successfully!\n\n${JSON.stringify( result, null, 2 )}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error updating ticket: ${error.message}` }, ], isError: true, }; } },
- src/tools/tickets.js:143-171 (schema)Zod schema defining the input parameters and validation for the 'update_ticket' tool.schema: { id: z.number().describe("Ticket ID to update"), subject: z.string().optional().describe("Updated ticket subject"), comment: z .string() .optional() .describe("Internal (non-public) comment to add"), priority: z .enum(["urgent", "high", "normal", "low"]) .optional() .describe("Updated ticket priority"), status: z .enum(["new", "open", "pending", "hold", "solved", "closed"]) .optional() .describe("Updated ticket status"), assignee_id: z .number() .optional() .describe("User ID of the new assignee"), group_id: z.number().optional().describe("New group ID for the ticket"), type: z .enum(["problem", "incident", "question", "task"]) .optional() .describe("Updated ticket type"), tags: z .array(z.string()) .optional() .describe("Updated tags for the ticket"), },
- src/server.js:47-52 (registration)The registration loop that adds the 'update_ticket' tool (included in allTools via ticketsTools) to the MCP server using server.tool().// Register each tool with the server allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:89-94 (helper)Supporting helper method in ZendeskClient that performs the actual API PUT request to update a ticket.async updateTicket(id, data) { return this.request("PUT", `/tickets/${id}.json`, { ticket: data, public: false, }); }