Skip to main content
Glama
JurreBrandsenInfoSupport

Zendesk API MCP Server

create_macro

Streamline Zendesk ticket management by creating macros with specific actions, such as modifying fields or setting values, to automate repetitive tasks and improve efficiency.

Input Schema

NameRequiredDescriptionDefault
actionsYesActions to perform when macro is applied
descriptionNoMacro description
titleYesMacro title

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "actions": { "description": "Actions to perform when macro is applied", "items": { "additionalProperties": false, "properties": { "field": { "description": "Field to modify", "type": "string" }, "value": { "description": "Value to set" } }, "required": [ "field" ], "type": "object" }, "type": "array" }, "description": { "description": "Macro description", "type": "string" }, "title": { "description": "Macro title", "type": "string" } }, "required": [ "title", "actions" ], "type": "object" }

Implementation Reference

  • The asynchronous handler function that processes the create_macro tool invocation. It builds the macro data object from the input parameters (title, description, actions) and calls zendeskClient.createMacro to perform the API request, then formats a success or error response.
    handler: async ({ title, description, actions }) => { try { const macroData = { title, description, actions }; const result = await zendeskClient.createMacro(macroData); return { content: [{ type: "text", text: `Macro created successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating macro: ${error.message}` }], isError: true }; } }
  • Zod schema for validating inputs to the create_macro tool: required 'title' (string), optional 'description' (string), and 'actions' (array of objects each with 'field' (string) and 'value' (any)).
    schema: { title: z.string().describe("Macro title"), description: z.string().optional().describe("Macro description"), actions: z.array(z.object({ field: z.string().describe("Field to modify"), value: z.any().describe("Value to set") })).describe("Actions to perform when macro is applied") },
  • src/server.js:48-52 (registration)
    Registration loop in the MCP server that dynamically registers all tools, including 'create_macro', by iterating over the combined allTools array (which includes macrosTools containing create_macro) and calling server.tool() for each.
    allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
  • ZendeskClient helper method invoked by the create_macro handler. Performs a POST request to the Zendesk Macros API endpoint (/macros.json) with the macro data wrapped in a 'macro' object.
    async createMacro(data) { return this.request("POST", "/macros.json", { macro: data }); }

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/JurreBrandsenInfoSupport/zendesk-mcp'

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