delete_webhook
Delete a webhook by providing its ID. Removes the specified webhook from your Eduframe account.
Instructions
Delete a webhook.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the webhook to delete |
Implementation Reference
- src/tools/webhooks.ts:111-120 (handler)Handler function for the delete_webhook tool. Takes an 'id' parameter, calls apiDelete on /webhooks/{id}, logs the response, and returns a formatted delete result.
async ({ id }) => { try { const record = await apiDelete<EduframeRecord>(`/webhooks/${id}`); void logResponse("delete_webhook", { id }, record); return formatDelete(record, "webhook"); } catch (error) { return formatError(error); } }, ); - src/tools/webhooks.ts:106-110 (schema)Input schema for delete_webhook, requiring a positive integer 'id' parameter. Includes metadata: destructiveHint: true, idempotentHint: true.
{ description: "Delete a webhook.", annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the webhook to delete") }, }, - src/tools/webhooks.ts:104-120 (registration)Registration of the delete_webhook tool via server.registerTool within registerWebhookTools function.
server.registerTool( "delete_webhook", { description: "Delete a webhook.", annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the webhook to delete") }, }, async ({ id }) => { try { const record = await apiDelete<EduframeRecord>(`/webhooks/${id}`); void logResponse("delete_webhook", { id }, record); return formatDelete(record, "webhook"); } catch (error) { return formatError(error); } }, ); - src/tools/index.ts:125-131 (registration)registerWebhookTools is listed in the tools array and invoked by registerAllTools to register all webhook tools including delete_webhook.
registerWebhookTools, ]; export function registerAllTools(server: McpServer): void { for (const register of tools) { register(server); } - src/api.ts:214-229 (helper)The apiDelete helper function used by the handler to perform the actual HTTP DELETE request to the Eduframe API.
/** * Perform a DELETE request to remove a resource. * * @param path - API path, e.g. "/leads/1" */ export async function apiDelete<T>(path: string): Promise<T> { const { token } = getConfig(); const url = buildUrl(path); const response = await fetch(url.toString(), { method: "DELETE", headers: buildHeaders(token), }); return handleResponse<T>(response); }