get_view
Fetch specific Zendesk support views by providing the View ID, enabling efficient management and retrieval of ticket data via the Zendesk API MCP Server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | View ID |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "View ID",
"type": "number"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/tools/views.js:36-51 (handler)The handler function that implements the core logic of the 'get_view' tool by calling zendeskClient.getView(id) and formatting the response or error.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)Input schema validation using Zod for the required 'id' parameter.schema: { id: z.number().describe("View ID") },
- src/tools/views.js:30-52 (registration)The complete tool definition object for 'get_view', which is spread into the allTools array and registered with the MCP server.{ name: "get_view", description: "Get a specific view by ID", schema: { id: z.number().describe("View ID") }, 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/zendesk-client.js:191-193 (helper)Helper method in ZendeskClient class that performs the HTTP GET request to the Zendesk Views API endpoint.async getView(id) { return this.request("GET", `/views/${id}.json`); }
- src/server.js:37-37 (registration)Inclusion of viewsTools (containing get_view) into the allTools array, which is then registered with the MCP server....viewsTools,