Skip to main content
Glama
koundinya

Zendesk MCP Server

by koundinya

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

TableJSON Schema
NameRequiredDescriptionDefault
noteYesThe content of the private note
ticket_idYesThe ID of the ticket to add a note to

Implementation Reference

  • 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
        };
      }
    }
  • 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")
    },
  • 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
          };
        }
      }
    );
  • 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`,
    });

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/koundinya/zd-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server