get_view
Retrieve a specific Zendesk view by its ID to access ticket filtering and organization settings for support management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | View ID |
Implementation Reference
- src/tools/views.js:36-51 (handler)The handler function for the 'get_view' tool. It takes a view ID, fetches the view data from Zendesk client, and returns the JSON-formatted result or an error message.handler: async ({ id }) => { try { const result = await zendeskClient.getView(id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error getting view: ${error.message}` }], isError: true }; } }
- src/tools/views.js:33-35 (schema)Zod schema for the 'get_view' tool input: requires a numeric view ID.schema: { id: z.number().describe("View ID") },
- src/server.js:48-52 (registration)Registers the 'get_view' tool (among others) with the MCP server using server.tool(tool.name, tool.schema, tool.handler, description). Note that get_view is included via ...viewsTools in allTools.allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:191-192 (helper)ZendeskClient.getView(id) method called by the handler, which performs the actual API GET request to retrieve the view.async getView(id) { return this.request("GET", `/views/${id}.json`);