list_views
Retrieve and manage ticket views in Zendesk Support with pagination controls to organize and access customer service workflows efficiently.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| per_page | No | Number of views per page (max 100) |
Implementation Reference
- src/tools/views.js:12-28 (handler)The primary handler function for the 'list_views' MCP tool, which prepares parameters, calls the Zendesk client, and returns formatted JSON results or an error message.handler: async ({ page, per_page }) => { try { const params = { page, per_page }; const result = await zendeskClient.listViews(params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error listing views: ${error.message}` }], isError: true }; } }
- src/tools/views.js:8-11 (schema)Zod input schema defining optional pagination parameters for the list_views tool.schema: { page: z.number().optional().describe("Page number for pagination"), per_page: z.number().optional().describe("Number of views per page (max 100)") },
- src/zendesk-client.js:187-189 (helper)ZendeskClient helper method that performs the actual API request to retrieve the list of views.async listViews(params) { return this.request("GET", "/views.json", null, params); }
- src/server.js:31-52 (registration)Tool registration block where viewsTools (containing list_views) is included in allTools and each tool is registered with the MCP server via server.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, }); });