Apply macro

Apply one of your macros to a ticket.

MCP tool gorgias_write → apply_macro

write Confirm

Runs the macro as an agent would: its reply text goes to the customer and its actions, such as tags, status and assignee, run in the order the macro lists them. Variables in the text are filled from the ticket. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: apply_macro
NameTypeDescription
ticket_id integer required integer Ticket ID from search_tickets.
macro string required string Macro name or macro_id from list_macros.
close_ticket boolean boolean Use Apply macro and close. Default: false.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "gorgias_write",
    "arguments": {
      "operation": "apply_macro",
      "arguments": {
        "ticket_id": 10511,
        "macro": "Order status",
        "close_ticket": false
      }
    }
  }
}

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "ticket_id": 10511,
    "macro": "Order status",
    "reply_sent": true,
    "actions_run": [
      "Add tags",
      "Set status"
    ],
    "ticket_status": "open"
  },
  "isError": false
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.