Skip to main content
Glama
JurreBrandsenInfoSupport

Zendesk API MCP Server

get_macro

Retrieve a specific macro from Zendesk Support using its ID to automate ticket responses and streamline customer service workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesMacro ID

Implementation Reference

  • The handler function for the 'get_macro' tool, which retrieves a specific macro by ID from Zendesk and returns the JSON response or an error message.
    handler: async ({ id }) => {
      try {
        const result = await zendeskClient.getMacro(id);
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error getting macro: ${error.message}` }],
          isError: true
        };
      }
    }
  • Zod schema for the 'get_macro' tool input, requiring a numeric 'id' parameter.
    schema: {
      id: z.number().describe("Macro ID")
    },
  • src/server.js:47-52 (registration)
    Registration loop that registers all tools, including 'get_macro' from macrosTools, using server.tool(name, schema, handler).
    // Register each tool with the server
    allTools.forEach((tool) => {
      server.tool(tool.name, tool.schema, tool.handler, {
        description: tool.description,
      });
    });
  • The underlying getMacro method in ZendeskClient that makes the API request to fetch the macro by ID.
    async getMacro(id) {
      return this.request("GET", `/macros/${id}.json`);
    }

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