update_view
Modify existing Zendesk views by updating their title, description, or filtering conditions to organize and manage ticket displays.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | View ID to update | |
| title | No | Updated view title | |
| description | No | Updated view description | |
| conditions | No | Updated conditions |
Implementation Reference
- src/tools/views.js:115-136 (handler)The handler function that executes the logic for the update_view tool, preparing the data and calling the Zendesk client to update the view.handler: async ({ id, title, description, conditions }) => { try { const viewData = {}; if (title !== undefined) viewData.title = title; if (description !== undefined) viewData.description = description; if (conditions !== undefined) viewData.conditions = conditions; const result = await zendeskClient.updateView(id, viewData); return { content: [{ type: "text", text: `View updated successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating view: ${error.message}` }], isError: true }; } }
- src/tools/views.js:98-114 (schema)Zod schema defining the input parameters for the update_view tool: id (required), title, description, conditions (optional).schema: { id: z.number().describe("View ID to update"), title: z.string().optional().describe("Updated view title"), description: z.string().optional().describe("Updated view description"), conditions: z.object({ all: z.array(z.object({ field: z.string().describe("Field to filter on"), operator: z.string().describe("Operator for comparison"), value: z.any().describe("Value to compare against") })).optional(), any: z.array(z.object({ field: z.string().describe("Field to filter on"), operator: z.string().describe("Operator for comparison"), value: z.any().describe("Value to compare against") })).optional() }).optional().describe("Updated conditions") },
- src/tools/views.js:95-137 (registration)The complete tool registration object for 'update_view', including name, description, schema, and handler, exported as part of viewsTools.{ name: "update_view", description: "Update an existing view", schema: { id: z.number().describe("View ID to update"), title: z.string().optional().describe("Updated view title"), description: z.string().optional().describe("Updated view description"), conditions: z.object({ all: z.array(z.object({ field: z.string().describe("Field to filter on"), operator: z.string().describe("Operator for comparison"), value: z.any().describe("Value to compare against") })).optional(), any: z.array(z.object({ field: z.string().describe("Field to filter on"), operator: z.string().describe("Operator for comparison"), value: z.any().describe("Value to compare against") })).optional() }).optional().describe("Updated conditions") }, handler: async ({ id, title, description, conditions }) => { try { const viewData = {}; if (title !== undefined) viewData.title = title; if (description !== undefined) viewData.description = description; if (conditions !== undefined) viewData.conditions = conditions; const result = await zendeskClient.updateView(id, viewData); return { content: [{ type: "text", text: `View updated successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating view: ${error.message}` }], isError: true }; } } },
- src/zendesk-client.js:199-201 (helper)Helper method in ZendeskClient that performs the actual API request to update a view.async updateView(id, data) { return this.request("PUT", `/views/${id}.json`, { view: data }); }
- src/server.js:48-52 (registration)Generic registration loop that registers all tools, including update_view from viewsTools, to the MCP server.allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });