update_ticket
Update the status, priority, or add a comment to an existing ticket across supported ITSM systems.
Instructions
Update the status, priority, or add a comment to an existing ticket
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticket_id | Yes | ID of the ticket to update | |
| status | No | New status | |
| priority | No | Priority level | medium |
| comment | No | Comment to add to the ticket | |
| system | No | ITSM system to use | jira |
Implementation Reference
- index.js:119-128 (handler)The business logic handler for update_ticket. Looks up ticket by ID in the in-memory Map, updates status/priority if provided, appends a comment if provided, updates the timestamp, and returns the updated ticket summary.
function updateTicket({ ticket_id, status, priority, comment }) { const ticket = tickets.get(ticket_id); if (!ticket) return { success: false, error: `Ticket ${ticket_id} not found` }; if (status) ticket.status = status; if (priority) ticket.priority = priority; if (comment) ticket.comments.push({ text: comment, created_at: new Date().toISOString(), internal: false }); ticket.updated_at = new Date().toISOString(); tickets.set(ticket_id, ticket); return { success: true, ticket: { id: ticket.id, title: ticket.title, status: ticket.status, priority: ticket.priority, system: ticket.system } }; } - index.js:224-245 (registration)The MCP server tool registration for 'update_ticket' via server.tool(). Defines the name, description, Zod input schema (ticket_id, optional status enum, optional priority, optional comment, optional system), annotations, and the async handler that calls the updateTicket helper.
server.tool( 'update_ticket', 'Update the status, priority, or add a comment to an existing ticket', { ticket_id: z.string().describe('ID of the ticket to update'), status: z.enum(['open', 'in_progress', 'resolved', 'closed']).optional().describe('New status'), priority: prioritySchema.optional(), comment: z.string().optional().describe('Comment to add to the ticket'), system: systemSchema.optional(), }, { title: 'Update Ticket', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false, }, async ({ ticket_id, status, priority, comment }) => { const result = updateTicket({ ticket_id, status, priority, comment }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }, ); - index.js:227-233 (schema)Zod input schema for update_ticket: ticket_id (required string), status (optional enum: open/in_progress/resolved/closed), priority (optional via prioritySchema), comment (optional string), system (optional via systemSchema).
{ ticket_id: z.string().describe('ID of the ticket to update'), status: z.enum(['open', 'in_progress', 'resolved', 'closed']).optional().describe('New status'), priority: prioritySchema.optional(), comment: z.string().optional().describe('Comment to add to the ticket'), system: systemSchema.optional(), }, - index.js:112-118 (helper)Helper service function updateTicket on the frontend MCP client service. Calls the MCP tool 'update_ticket' with ticket_id, spread updates, and optional system parameter.
function getTicket({ ticket_id }) { const ticket = tickets.get(ticket_id); if (!ticket) return { success: false, error: `Ticket ${ticket_id} not found` }; return { success: true, ticket: { ...ticket } }; }