delete_article
Remove specific articles from Zendesk Guide by providing the article ID, ensuring streamlined content management and organization.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Article ID to delete |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "Article ID to delete",
"type": "number"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/tools/help-center.js:141-156 (handler)The handler function for the 'delete_article' MCP tool. It takes an article ID, calls the zendeskClient.deleteArticle(id) helper, and returns a formatted success or error response.handler: async ({ id }) => { try { await zendeskClient.deleteArticle(id); return { content: [{ type: "text", text: `Article ${id} deleted successfully!` }] }; } catch (error) { return { content: [{ type: "text", text: `Error deleting article: ${error.message}` }], isError: true }; } }
- src/tools/help-center.js:138-140 (schema)Input schema for the 'delete_article' tool using Zod, requiring a numeric 'id' parameter.schema: { id: z.number().describe("Article ID to delete") },
- src/tools/help-center.js:135-157 (registration)Tool definition object for 'delete_article' within the helpCenterTools array, which is imported into server.js and registered with the MCP server via server.tool().{ name: "delete_article", description: "Delete a Help Center article", schema: { id: z.number().describe("Article ID to delete") }, handler: async ({ id }) => { try { await zendeskClient.deleteArticle(id); return { content: [{ type: "text", text: `Article ${id} deleted successfully!` }] }; } catch (error) { return { content: [{ type: "text", text: `Error deleting article: ${error.message}` }], isError: true }; } } }
- src/zendesk-client.js:277-279 (helper)ZendeskClient helper method that performs the actual DELETE API request to remove the Help Center article by ID.async deleteArticle(id) { return this.request("DELETE", `/help_center/articles/${id}.json`); }