zendesk_add_private_note
Add a private internal note to a Zendesk ticket using the ticket ID. This tool enables internal communication within the Zendesk ticketing system without sharing details externally.
Instructions
Add a private internal note to a Zendesk ticket
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | The content of the private note | |
| ticket_id | Yes | The ID of the ticket to add a note to |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"note": {
"description": "The content of the private note",
"type": "string"
},
"ticket_id": {
"description": "The ID of the ticket to add a note to",
"type": "string"
}
},
"required": [
"ticket_id",
"note"
],
"type": "object"
}
Implementation Reference
- src/tools/index.ts:235-270 (handler)The handler function that implements the tool logic: updates the Zendesk ticket with a private note using the node-zendesk client.async ({ ticket_id, note }) => { try { const result = await new Promise((resolve, reject) => { (client as any).tickets.update(parseInt(ticket_id, 10), { ticket: { comment: { body: note, public: false } } }, (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:231-234 (schema)Zod input schema for the tool parameters: ticket_id and note.{ ticket_id: z.string().describe("The ID of the ticket to add a note to"), note: z.string().describe("The content of the private note") },
- src/tools/index.ts:228-271 (registration)MCP server tool registration call within zenDeskTools function.server.tool( "zendesk_add_private_note", "Add a private internal note to a Zendesk ticket", { ticket_id: z.string().describe("The ID of the ticket to add a note to"), note: z.string().describe("The content of the private note") }, async ({ ticket_id, note }) => { try { const result = await new Promise((resolve, reject) => { (client as any).tickets.update(parseInt(ticket_id, 10), { ticket: { comment: { body: note, public: false } } }, (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:84-88 (helper)Shared Zendesk API client initialized from environment variables, used by the tool handler.const client = zendesk.createClient({ username: process.env.ZENDESK_EMAIL as string, token: process.env.ZENDESK_TOKEN as string, remoteUri: `https://${process.env.ZENDESK_SUBDOMAIN}.zendesk.com/api/v2`, });