Skip to main content
Glama
koundinya
by koundinya

zendesk_create_ticket

Create a Zendesk ticket with defined subject, description, priority, status, type, and tags to manage support requests effectively.

Instructions

Create a new Zendesk ticket

Input Schema

NameRequiredDescriptionDefault
descriptionYesThe initial description or comment for the ticket
priorityNoThe priority of the ticket
statusNoThe status of the ticket
subjectYesThe subject of the ticket
tagsNoTags to add to the ticket
typeNoThe type of the ticket

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "description": { "description": "The initial description or comment for the ticket", "type": "string" }, "priority": { "description": "The priority of the ticket", "enum": [ "low", "normal", "high", "urgent" ], "type": "string" }, "status": { "description": "The status of the ticket", "enum": [ "new", "open", "pending", "hold", "solved", "closed" ], "type": "string" }, "subject": { "description": "The subject of the ticket", "type": "string" }, "tags": { "description": "Tags to add to the ticket", "items": { "type": "string" }, "type": "array" }, "type": { "description": "The type of the ticket", "enum": [ "problem", "incident", "question", "task" ], "type": "string" } }, "required": [ "subject", "description" ], "type": "object" }

Implementation Reference

  • The handler function that executes the zendesk_create_ticket tool: constructs ticket data from inputs and calls the Zendesk API to create the ticket.
    async ({ subject, description, priority, status, type, tags }) => { try { const ticketData: any = { ticket: { subject, comment: { body: description }, } }; if (priority) ticketData.ticket.priority = priority; if (status) ticketData.ticket.status = status; if (type) ticketData.ticket.type = type; if (tags) ticketData.ticket.tags = tags; const result = await new Promise((resolve, reject) => { (client as any).tickets.create(ticketData, (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 }; } }
  • Input schema (using Zod) defining parameters for the zendesk_create_ticket tool.
    { subject: z.string().describe("The subject of the ticket"), description: z.string().describe("The initial description or comment for the ticket"), priority: z.enum(['low', 'normal', 'high', 'urgent']).optional().describe("The priority of the ticket"), status: z.enum(['new', 'open', 'pending', 'hold', 'solved', 'closed']).optional().describe("The status of the ticket"), type: z.enum(['problem', 'incident', 'question', 'task']).optional().describe("The type of the ticket"), tags: z.array(z.string()).optional().describe("Tags to add to the ticket") },
  • Registration of the zendesk_create_ticket tool on the MCP server, including name, description, input schema, and handler.
    server.tool( "zendesk_create_ticket", "Create a new Zendesk ticket", { subject: z.string().describe("The subject of the ticket"), description: z.string().describe("The initial description or comment for the ticket"), priority: z.enum(['low', 'normal', 'high', 'urgent']).optional().describe("The priority of the ticket"), status: z.enum(['new', 'open', 'pending', 'hold', 'solved', 'closed']).optional().describe("The status of the ticket"), type: z.enum(['problem', 'incident', 'question', 'task']).optional().describe("The type of the ticket"), tags: z.array(z.string()).optional().describe("Tags to add to the ticket") }, async ({ subject, description, priority, status, type, tags }) => { try { const ticketData: any = { ticket: { subject, comment: { body: description }, } }; if (priority) ticketData.ticket.priority = priority; if (status) ticketData.ticket.status = status; if (type) ticketData.ticket.type = type; if (tags) ticketData.ticket.tags = tags; const result = await new Promise((resolve, reject) => { (client as any).tickets.create(ticketData, (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 }; } } );
  • Zendesk client instance created from environment variables, used by the zendesk_create_ticket 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`, });
  • src/index.ts:34-34 (registration)
    Top-level call to register all Zendesk tools, including zendesk_create_ticket, on the MCP server.
    zenDeskTools(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