zendesk_add_public_note
Add a public comment to a Zendesk ticket using the ticket ID and comment content to provide updates or responses visible to all users.
Instructions
Add a public comment to a Zendesk ticket
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comment | Yes | The content of the public comment | |
| ticket_id | Yes | The ID of the ticket to add a comment to |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"comment": {
"description": "The content of the public comment",
"type": "string"
},
"ticket_id": {
"description": "The ID of the ticket to add a comment to",
"type": "string"
}
},
"required": [
"ticket_id",
"comment"
],
"type": "object"
}
Implementation Reference
- src/tools/index.ts:280-315 (handler)Handler function that executes the zendesk_add_public_note tool by updating the ticket with a public comment using the Zendesk client.async ({ ticket_id, comment }) => { try { const result = await new Promise((resolve, reject) => { (client as any).tickets.update(parseInt(ticket_id, 10), { ticket: { comment: { body: comment, public: true } } }, (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:276-279 (schema)Zod schema defining inputs: ticket_id (string) and comment (string).{ ticket_id: z.string().describe("The ID of the ticket to add a comment to"), comment: z.string().describe("The content of the public comment") },
- src/tools/index.ts:273-316 (registration)Registration of the zendesk_add_public_note tool with McpServer, including name, description, schema, and inline handler.server.tool( "zendesk_add_public_note", "Add a public comment to a Zendesk ticket", { ticket_id: z.string().describe("The ID of the ticket to add a comment to"), comment: z.string().describe("The content of the public comment") }, async ({ ticket_id, comment }) => { try { const result = await new Promise((resolve, reject) => { (client as any).tickets.update(parseInt(ticket_id, 10), { ticket: { comment: { body: comment, public: true } } }, (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 }; } } );