add_comment
Add a public comment or internal note to an existing ticket in supported ITSM systems (ServiceNow, Jira, Zendesk, etc.).
Instructions
Add a comment (public or internal) to an existing ticket
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticket_id | Yes | ID of the ticket to comment on | |
| comment | Yes | Comment text | |
| internal | No | True = internal note not visible to end users | |
| system | No | ITSM system to use | jira |
Implementation Reference
- index.js:149-157 (handler)Business logic function that adds a comment (public or internal) to an existing ticket in the in-memory store.
function addComment({ ticket_id, comment, internal = false }) { const ticket = tickets.get(ticket_id); if (!ticket) return { success: false, error: `Ticket ${ticket_id} not found` }; const commentObj = { text: comment, internal, created_at: new Date().toISOString() }; ticket.comments.push(commentObj); ticket.updated_at = new Date().toISOString(); tickets.set(ticket_id, ticket); return { success: true, comment: commentObj, ticket_id }; } - index.js:290-310 (registration)MCP server.tool registration for 'add_comment' with Zod schema and annotation metadata.
server.tool( 'add_comment', 'Add a comment (public or internal) to an existing ticket', { ticket_id: z.string().describe('ID of the ticket to comment on'), comment: z.string().describe('Comment text'), internal: z.boolean().default(false).describe('True = internal note not visible to end users'), system: systemSchema.optional(), }, { title: 'Add Comment', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false, }, async ({ ticket_id, comment, internal }) => { const result = addComment({ ticket_id, comment, internal }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }, ); - index.js:294-298 (schema)Zod input schema for the add_comment tool defining ticket_id, comment, internal, and optional system.
ticket_id: z.string().describe('ID of the ticket to comment on'), comment: z.string().describe('Comment text'), internal: z.boolean().default(false).describe('True = internal note not visible to end users'), system: systemSchema.optional(), }, - Frontend service helper method that calls the 'add_comment' tool via MCP.
async addComment(ticketId, comment, internal = false, system = null) { return this.callTool('add_comment', { ticket_id: ticketId, comment, internal, ...(system && { system }), }); }