Skip to main content
Glama
callback-delete.ts2.06 kB
/** * Callback Delete Tool * * Delete/unregister a webhook/callback. */ import { z } from "zod"; import { CallbackDeleteInputSchema, CallbackDeleteOutputSchema } from "./schemas.js"; import { ErrorHandler } from "../../errors/error-handler.js"; import { ToolContext } from "../../errors/types.js"; import { FreshBooksClientWrapper } from "../../client/index.js"; /** * Tool definition for callback_delete */ export const callbackDeleteTool = { name: "callback_delete", description: `Delete/unregister a webhook/callback from FreshBooks. WHEN TO USE: - User wants to stop receiving webhook notifications - User says "delete webhook", "remove callback", "unregister webhook" - User needs to clean up unused webhook subscriptions REQUIRED INFO: - Callback ID to delete - Account ID WHAT HAPPENS: - Webhook is permanently deleted - No more events will be sent to the endpoint - Cannot be undone (must recreate to re-enable) EXAMPLE PROMPTS: - "Delete webhook 123" - "Remove callback 456" - "Unregister the webhook for invoices" - "Stop sending payment notifications" RETURNS: Confirmation that the webhook was deleted successfully.`, inputSchema: CallbackDeleteInputSchema, outputSchema: CallbackDeleteOutputSchema, async execute( input: z.infer<typeof CallbackDeleteInputSchema>, client: FreshBooksClientWrapper ): Promise<z.infer<typeof CallbackDeleteOutputSchema>> { const handler = ErrorHandler.wrapHandler( 'callback_delete', async (input: z.infer<typeof CallbackDeleteInputSchema>, _context: ToolContext) => { const { accountId, callbackId } = input; await client.executeWithRetry('callback_delete', async (fbClient) => { const response = await fbClient.callbacks.delete(accountId, String(callbackId)); if (!response.ok) { throw response.error; } return response.data; }); return { success: true, callbackId, }; } ); return handler(input, { accountId: input.accountId }); }, };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Good-Samaritan-Software-LLC/freshbooks-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server