zendesk_update_ticket
Modify Zendesk ticket properties such as priority, status, assignee, tags, subject, and type by specifying the ticket ID.
Instructions
Update a Zendesk ticket's properties
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignee_id | No | The ID of the agent to assign the ticket to | |
| priority | No | The new priority of the ticket | |
| status | No | The new status of the ticket | |
| subject | No | The new subject of the ticket | |
| tags | No | Tags to set on the ticket (replaces existing tags) | |
| ticket_id | Yes | The ID of the ticket to update | |
| type | No | The new type of the ticket |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"assignee_id": {
"description": "The ID of the agent to assign the ticket to",
"type": "string"
},
"priority": {
"description": "The new priority of the ticket",
"enum": [
"low",
"normal",
"high",
"urgent"
],
"type": "string"
},
"status": {
"description": "The new status of the ticket",
"enum": [
"new",
"open",
"pending",
"hold",
"solved",
"closed"
],
"type": "string"
},
"subject": {
"description": "The new subject of the ticket",
"type": "string"
},
"tags": {
"description": "Tags to set on the ticket (replaces existing tags)",
"items": {
"type": "string"
},
"type": "array"
},
"ticket_id": {
"description": "The ID of the ticket to update",
"type": "string"
},
"type": {
"description": "The new type of the ticket",
"enum": [
"problem",
"incident",
"question",
"task"
],
"type": "string"
}
},
"required": [
"ticket_id"
],
"type": "object"
}
Implementation Reference
- src/tools/index.ts:131-171 (handler)The handler function for zendesk_update_ticket that constructs the update data from inputs and calls the Zendesk tickets.update API.async ({ ticket_id, subject, status, priority, type, assignee_id, tags }) => { try { const ticketData: any = { ticket: {} }; // Only add properties that are provided if (subject) ticketData.ticket.subject = subject; if (status) ticketData.ticket.status = status; if (priority) ticketData.ticket.priority = priority; if (type) ticketData.ticket.type = type; if (assignee_id) ticketData.ticket.assignee_id = parseInt(assignee_id, 10); if (tags) ticketData.ticket.tags = tags; const result = await new Promise((resolve, reject) => { (client as any).tickets.update(parseInt(ticket_id, 10), ticketData, (error: Error | undefined, req: any, result: any) => { if (error) { console.log(error); reject(error); } else { resolve(result); } }); }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message || 'Unknown error occurred'}` }], isError: true }; } }
- src/tools/index.ts:122-130 (schema)Zod input schema defining parameters for updating a Zendesk ticket.{ ticket_id: z.string().describe("The ID of the ticket to update"), subject: z.string().optional().describe("The new subject of the ticket"), status: z.enum(['new', 'open', 'pending', 'hold', 'solved', 'closed']).optional().describe("The new status of the ticket"), priority: z.enum(['low', 'normal', 'high', 'urgent']).optional().describe("The new priority of the ticket"), type: z.enum(['problem', 'incident', 'question', 'task']).optional().describe("The new type of the ticket"), assignee_id: z.string().optional().describe("The ID of the agent to assign the ticket to"), tags: z.array(z.string()).optional().describe("Tags to set on the ticket (replaces existing tags)") },
- src/tools/index.ts:119-172 (registration)Full registration of the zendesk_update_ticket tool with MCP server using server.tool, including description, schema, and inline handler.server.tool( "zendesk_update_ticket", "Update a Zendesk ticket's properties", { ticket_id: z.string().describe("The ID of the ticket to update"), subject: z.string().optional().describe("The new subject of the ticket"), status: z.enum(['new', 'open', 'pending', 'hold', 'solved', 'closed']).optional().describe("The new status of the ticket"), priority: z.enum(['low', 'normal', 'high', 'urgent']).optional().describe("The new priority of the ticket"), type: z.enum(['problem', 'incident', 'question', 'task']).optional().describe("The new type of the ticket"), assignee_id: z.string().optional().describe("The ID of the agent to assign the ticket to"), tags: z.array(z.string()).optional().describe("Tags to set on the ticket (replaces existing tags)") }, async ({ ticket_id, subject, status, priority, type, assignee_id, tags }) => { try { const ticketData: any = { ticket: {} }; // Only add properties that are provided if (subject) ticketData.ticket.subject = subject; if (status) ticketData.ticket.status = status; if (priority) ticketData.ticket.priority = priority; if (type) ticketData.ticket.type = type; if (assignee_id) ticketData.ticket.assignee_id = parseInt(assignee_id, 10); if (tags) ticketData.ticket.tags = tags; const result = await new Promise((resolve, reject) => { (client as any).tickets.update(parseInt(ticket_id, 10), ticketData, (error: Error | undefined, req: any, result: any) => { if (error) { console.log(error); reject(error); } else { resolve(result); } }); }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message || 'Unknown error occurred'}` }], isError: true }; } } );