get_article
Retrieve specific Zendesk articles by ID using the Zendesk API MCP Server. Simplify access to support content for efficient troubleshooting and knowledge sharing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Article ID |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "Article ID",
"type": "number"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/tools/help-center.js:38-53 (handler)The main handler function for the 'get_article' tool. It takes an article ID, fetches the article using the Zendesk client, and returns the result as JSON or an error message.handler: async ({ id }) => { try { const result = await zendeskClient.getArticle(id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error getting article: ${error.message}` }], isError: true }; } }
- src/tools/help-center.js:35-37 (schema)Zod schema defining the input parameter 'id' as a required number for the 'get_article' tool.schema: { id: z.number().describe("Article ID") },
- src/tools/help-center.js:32-54 (registration)The tool definition object for 'get_article' within the helpCenterTools array, which is later registered with the MCP server.{ name: "get_article", description: "Get a specific Help Center article by ID", schema: { id: z.number().describe("Article ID") }, handler: async ({ id }) => { try { const result = await zendeskClient.getArticle(id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error getting article: ${error.message}` }], isError: true }; } } },
- src/zendesk-client.js:259-261 (helper)Helper method in ZendeskClient that performs the actual API request to retrieve a Help Center article by ID.async getArticle(id) { return this.request("GET", `/help_center/articles/${id}.json`); }
- src/server.js:48-52 (registration)Generic registration loop where all tools, including 'get_article' from helpCenterTools, are registered with the MCP server using server.tool().allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });