smartlead_retrigger_failed_events
Retrigger failed webhook events for a specific campaign within a defined time period to ensure data delivery and system synchronization.
Instructions
Retrigger failed webhook events (Private Beta feature).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes | ID of the campaign to retrigger failed webhook events for | |
| fromTime | Yes | Start date/time in ISO 8601 format (e.g. 2025-03-21T00:00:00Z) | |
| toTime | Yes | End date/time in ISO 8601 format (e.g. 2025-04-04T23:59:59Z) |
Implementation Reference
- src/handlers/webhooks.ts:240-282 (handler)Core handler function: validates input params, makes authenticated POST request to SmartLead API endpoint `/campaigns/${campaign_id}/webhooks/retrigger-failed-events` with fromTime and toTime, returns JSON response or formatted error.async function handleRetriggerFailedEvents( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isRetriggerFailedEventsParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_retrigger_failed_events' ); } try { const smartLeadClient = createSmartLeadClient(apiClient); const { campaign_id, fromTime, toTime } = args; const response = await withRetry( async () => smartLeadClient.post(`/campaigns/${campaign_id}/webhooks/retrigger-failed-events`, { fromTime, toTime }), 'retrigger failed events' ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], isError: false, }; } catch (error: any) { return { content: [{ type: 'text', text: `API Error: ${error.response?.data?.message || error.message}` }], isError: true, }; } }
- src/tools/webhooks.ts:107-129 (schema)Tool metadata and input schema definition: specifies required parameters campaign_id, fromTime, toTime as strings, with descriptions.export const RETRIGGER_FAILED_EVENTS_TOOL: CategoryTool = { name: 'smartlead_retrigger_failed_events', description: 'Retrigger failed webhook events (Private Beta feature).', category: ToolCategory.WEBHOOKS, inputSchema: { type: 'object', properties: { campaign_id: { type: 'string', description: 'ID of the campaign to retrigger failed webhook events for', }, fromTime: { type: 'string', description: 'Start date/time in ISO 8601 format (e.g. 2025-03-21T00:00:00Z)', }, toTime: { type: 'string', description: 'End date/time in ISO 8601 format (e.g. 2025-04-04T23:59:59Z)', }, }, required: ['campaign_id', 'fromTime', 'toTime'], }, };
- src/index.ts:223-223 (registration)Registers all webhook tools, including smartlead_retrigger_failed_events, into the central ToolRegistry.toolRegistry.registerMany(webhookTools);
- src/types/webhooks.ts:103-113 (schema)Runtime type guard for validating input parameters against RetriggerFailedEventsParams interface (defined lines 42-46).export function isRetriggerFailedEventsParams(args: unknown): args is RetriggerFailedEventsParams { if (typeof args !== 'object' || args === null) return false; const params = args as Partial<RetriggerFailedEventsParams>; return ( typeof params.campaign_id === 'string' && typeof params.fromTime === 'string' && typeof params.toTime === 'string' ); }
- src/handlers/webhooks.ts:34-36 (handler)Dispatcher case in handleWebhookTool that routes the tool call to the specific handler function.case 'smartlead_retrigger_failed_events': { return handleRetriggerFailedEvents(args, apiClient, withRetry); }