list_triggers
Retrieve and manage Zendesk triggers by specifying page numbers and items per page, enabling efficient organization and automation of support workflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| per_page | No | Number of triggers per page (max 100) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"page": {
"description": "Page number for pagination",
"type": "number"
},
"per_page": {
"description": "Number of triggers per page (max 100)",
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/tools/triggers.js:12-27 (handler)The handler function for the 'list_triggers' tool. It constructs parameters from input, calls zendeskClient.listTriggers, and returns the JSON-stringified result or an error message.handler: async ({ page, per_page }) => { try { const params = { page, per_page }; const result = await zendeskClient.listTriggers(params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error listing triggers: ${error.message}` }], isError: true }; }
- src/tools/triggers.js:8-11 (schema)Zod schema defining the input parameters for the 'list_triggers' tool: optional page and per_page numbers.schema: { page: z.number().optional().describe("Page number for pagination"), per_page: z.number().optional().describe("Number of triggers per page (max 100)") },
- src/server.js:31-52 (registration)Registration of all tools, including 'list_triggers' from triggersTools, into the MCP server using server.tool() for each tool.const allTools = [ ...ticketsTools, ...usersTools, ...organizationsTools, ...groupsTools, ...macrosTools, ...viewsTools, ...triggersTools, ...automationsTools, ...searchTools, ...helpCenterTools, ...supportTools, ...talkTools, ...chatTools, ]; // Register each tool with the server allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/tools/triggers.js:5-29 (registration)Local definition of the 'list_triggers' tool object within the exported triggersTools array, including name, description, schema, and handler.{ name: "list_triggers", description: "List triggers in Zendesk", schema: { page: z.number().optional().describe("Page number for pagination"), per_page: z.number().optional().describe("Number of triggers per page (max 100)") }, handler: async ({ page, per_page }) => { try { const params = { page, per_page }; const result = await zendeskClient.listTriggers(params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error listing triggers: ${error.message}` }], isError: true }; } } },
- src/zendesk-client.js:208-209 (helper)Helper method in ZendeskClient that performs the actual API request to list triggers using the generic request method.async listTriggers(params) { return this.request("GET", "/triggers.json", null, params);