Skip to main content
Glama
koundinya

Zendesk MCP Server

by koundinya

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

TableJSON Schema
NameRequiredDescriptionDefault
commentYesThe content of the public comment
ticket_idYesThe ID of the ticket to add a comment to

Implementation Reference

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

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