Skip to main content
Glama
JurreBrandsenInfoSupport

Zendesk API MCP Server

update_macro

Modify Zendesk macros by updating title, description, and actions to streamline customer support workflows and maintain consistent ticket resolutions.

Input Schema

NameRequiredDescriptionDefault
actionsNoUpdated actions
descriptionNoUpdated macro description
idYesMacro ID to update
titleNoUpdated macro title

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "actions": { "description": "Updated actions", "items": { "additionalProperties": false, "properties": { "field": { "description": "Field to modify", "type": "string" }, "value": { "description": "Value to set" } }, "required": [ "field" ], "type": "object" }, "type": "array" }, "description": { "description": "Updated macro description", "type": "string" }, "id": { "description": "Macro ID to update", "type": "number" }, "title": { "description": "Updated macro title", "type": "string" } }, "required": [ "id" ], "type": "object" }

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'update_macro' tool. It constructs the update data from optional parameters and delegates to zendeskClient.updateMacro, returning formatted success or error responses.
    handler: async ({ id, title, description, actions }) => { try { const macroData = {}; if (title !== undefined) macroData.title = title; if (description !== undefined) macroData.description = description; if (actions !== undefined) macroData.actions = actions; const result = await zendeskClient.updateMacro(id, macroData); return { content: [{ type: "text", text: `Macro updated successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating macro: ${error.message}` }], isError: true }; } }
  • Zod schema for input validation of the 'update_macro' tool, requiring 'id' and allowing optional 'title', 'description', and 'actions'.
    schema: { id: z.number().describe("Macro ID to update"), title: z.string().optional().describe("Updated macro title"), description: z.string().optional().describe("Updated macro description"), actions: z.array(z.object({ field: z.string().describe("Field to modify"), value: z.any().describe("Value to set") })).optional().describe("Updated actions") },
  • The complete tool definition object for 'update_macro', including name, description, schema, and handler, which is part of the exported macrosTools array registered to the MCP server.
    { name: "update_macro", description: "Update an existing macro", schema: { id: z.number().describe("Macro ID to update"), title: z.string().optional().describe("Updated macro title"), description: z.string().optional().describe("Updated macro description"), actions: z.array(z.object({ field: z.string().describe("Field to modify"), value: z.any().describe("Value to set") })).optional().describe("Updated actions") }, handler: async ({ id, title, description, actions }) => { try { const macroData = {}; if (title !== undefined) macroData.title = title; if (description !== undefined) macroData.description = description; if (actions !== undefined) macroData.actions = actions; const result = await zendeskClient.updateMacro(id, macroData); return { content: [{ type: "text", text: `Macro updated successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating macro: ${error.message}` }], isError: true }; } } },
  • ZendeskClient helper method that sends a PUT request to the Zendesk API to update the specified macro.
    async updateMacro(id, data) { return this.request("PUT", `/macros/${id}.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