update_view
Modify Zendesk ticket views by updating view ID, title, description, or conditions to streamline ticket organization and filtering.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conditions | No | Updated conditions | |
| description | No | Updated view description | |
| id | Yes | View ID to update | |
| title | No | Updated view title |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"conditions": {
"additionalProperties": false,
"description": "Updated conditions",
"properties": {
"all": {
"items": {
"additionalProperties": false,
"properties": {
"field": {
"description": "Field to filter on",
"type": "string"
},
"operator": {
"description": "Operator for comparison",
"type": "string"
},
"value": {
"description": "Value to compare against"
}
},
"required": [
"field",
"operator"
],
"type": "object"
},
"type": "array"
},
"any": {
"items": {
"additionalProperties": false,
"properties": {
"field": {
"description": "Field to filter on",
"type": "string"
},
"operator": {
"description": "Operator for comparison",
"type": "string"
},
"value": {
"description": "Value to compare against"
}
},
"required": [
"field",
"operator"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"description": {
"description": "Updated view description",
"type": "string"
},
"id": {
"description": "View ID to update",
"type": "number"
},
"title": {
"description": "Updated view title",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/tools/views.js:115-136 (handler)The handler function that implements the core logic of the 'update_view' tool by conditionally building the update payload from input parameters and invoking the Zendesk client's updateView method, handling success and error responses.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: required id (number), optional title, description, and complex conditions object.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/server.js:31-52 (registration)Assembles all tool arrays (including viewsTools containing 'update_view') into allTools and registers each tool individually with the MCP server via server.tool(name, schema, handler, description).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/zendesk-client.js:199-200 (helper)Helper method in ZendeskClient that performs the actual API call: PUT request to /views/{id}.json with the view data payload.async updateView(id, data) { return this.request("PUT", `/views/${id}.json`, { view: data });