delete_organization
Remove an organization from Zendesk by specifying its ID, permanently deleting the organization and its associated data from the system.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Organization ID to delete |
Implementation Reference
- src/tools/organizations.js:130-145 (handler)The MCP tool handler function for 'delete_organization'. It invokes the Zendesk client to delete the organization by ID and returns a formatted success or error response.handler: async ({ id }) => { try { await zendeskClient.deleteOrganization(id); return { content: [{ type: "text", text: `Organization ${id} deleted successfully!` }] }; } catch (error) { return { content: [{ type: "text", text: `Error deleting organization: ${error.message}` }], isError: true }; } }
- src/tools/organizations.js:127-129 (schema)Zod schema defining the input parameter 'id' (number) for the delete_organization tool.schema: { id: z.number().describe("Organization ID to delete") },
- src/server.js:48-52 (registration)Registration code in the MCP server that dynamically registers all tools, including 'delete_organization', by iterating over the tools array and calling server.tool().allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:140-142 (helper)ZendeskClient helper method that performs the HTTP DELETE request to the Zendesk API endpoint for deleting an organization by ID.async deleteOrganization(id) { return this.request("DELETE", `/organizations/${id}.json`); }
- src/server.js:31-34 (registration)Construction of the allTools array that includes organizationsTools (containing delete_organization) which is then registered.const allTools = [ ...ticketsTools, ...usersTools, ...organizationsTools,