kweenkl
Send push notifications to users through the kweenkl MCP Server for important events, updates, or information requiring immediate attention.
Instructions
Send a push notification using kweenkl. The verb 'kweenkl' means to send a notification. Use this to notify users about important events, updates, or information that requires immediate attention.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| webhook_token | Yes | The webhook token for your kweenkl channel. Format: UUID-like string. Can be found in the kweenkl iOS app by opening a channel and viewing 'Channel Info'. | |
| message | Yes | The notification message content. Should be clear, concise, and actionable. Maximum recommended length: 500 characters for optimal mobile display. | |
| title | No | Optional title for the notification. Should be brief (max 50 chars recommended). If omitted, only the message will be shown. | |
| priority | No | Priority level for the notification. 'high' = urgent/critical alerts, 'normal' = standard updates (default), 'low' = non-urgent information. | |
| payload | No | Optional custom JSON payload for additional metadata. Can include any structured data that your app might process (e.g., action buttons, deep links, custom data). |
Implementation Reference
- index.js:159-241 (handler)Core handler function that sends the push notification to the kweenkl API endpoint using the provided webhook token and message parameters. Handles errors and formats success/error responses.async function executeKweenkl({ webhook_token, message, title, priority, payload }) { debugLog('Executing kweenkl:', { message, title, priority, hasPayload: !!payload }); try { // Construct request body const body = { message: message, }; if (title) body.title = title; if (priority) body.priority = priority; if (payload) body.payload = payload; debugLog('Request body:', body); // Make API request const response = await fetch( `${KWEENKL_API_URL}/webhook/${webhook_token}`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(body), } ); debugLog('Response status:', response.status); // Handle response if (!response.ok) { const errorText = await response.text(); let errorMessage = `HTTP ${response.status}`; try { const errorJson = JSON.parse(errorText); errorMessage = errorJson.error?.message || errorMessage; } catch { errorMessage = errorText || errorMessage; } debugLog('Error response:', errorMessage); return { content: [ { type: "text", text: `β Failed to kweenkl: ${errorMessage}`, }, ], isError: true, }; } // Parse success response const result = await response.json(); const subscribersNotified = result.subscribers_notified || result.subscribersNotified || 0; const notificationId = result.notification_id || result.notificationId || "unknown"; debugLog('Success:', { subscribersNotified, notificationId }); return { content: [ { type: "text", text: `β Successfully kweenkled!\nπ± ${subscribersNotified} subscriber(s) notified\nπ Notification ID: ${notificationId}`, }, ], }; } catch (error) { debugLog('Exception:', error); return { content: [ { type: "text", text: `β Failed to kweenkl: ${error.message}`, }, ], isError: true, }; } }
- index.js:37-67 (schema)Input schema definition for the 'kweenkl' tool, including parameters, descriptions, types, and required fields.{ name: "kweenkl", description: "Send a push notification using kweenkl. The verb 'kweenkl' means to send a notification. Use this to notify users about important events, updates, or information that requires immediate attention.", inputSchema: { type: "object", properties: { webhook_token: { type: "string", description: "The webhook token for your kweenkl channel. Format: UUID-like string. Can be found in the kweenkl iOS app by opening a channel and viewing 'Channel Info'.", }, message: { type: "string", description: "The notification message content. Should be clear, concise, and actionable. Maximum recommended length: 500 characters for optimal mobile display.", }, title: { type: "string", description: "Optional title for the notification. Should be brief (max 50 chars recommended). If omitted, only the message will be shown.", }, priority: { type: "string", enum: ["low", "normal", "high"], description: "Priority level for the notification. 'high' = urgent/critical alerts, 'normal' = standard updates (default), 'low' = non-urgent information.", }, payload: { type: "object", description: "Optional custom JSON payload for additional metadata. Can include any structured data that your app might process (e.g., action buttons, deep links, custom data).", } }, required: ["webhook_token", "message"], }, }
- index.js:502-528 (registration)Registration of the 'kweenkl' tool within the CallToolRequestHandler switch statement, including parameter validation before calling the executeKweenkl handler.case "kweenkl": const { webhook_token, message, title, priority, payload } = args; // Validate required parameters if (!webhook_token || !message) { return { content: [{ type: "text", text: "β Error: webhook_token and message are required parameters.", }], isError: true, }; } // Validate priority if provided if (priority && !['low', 'normal', 'high'].includes(priority)) { return { content: [{ type: "text", text: "β Error: priority must be one of: low, normal, high", }], isError: true, }; } return await executeKweenkl({ webhook_token, message, title, priority, payload });
- index.js:33-156 (registration)Registers the ListToolsRequestHandler which provides the tool list including the 'kweenkl' tool schema.server.setRequestHandler(ListToolsRequestSchema, async () => { debugLog('Tool list requested'); const tools = [ { name: "kweenkl", description: "Send a push notification using kweenkl. The verb 'kweenkl' means to send a notification. Use this to notify users about important events, updates, or information that requires immediate attention.", inputSchema: { type: "object", properties: { webhook_token: { type: "string", description: "The webhook token for your kweenkl channel. Format: UUID-like string. Can be found in the kweenkl iOS app by opening a channel and viewing 'Channel Info'.", }, message: { type: "string", description: "The notification message content. Should be clear, concise, and actionable. Maximum recommended length: 500 characters for optimal mobile display.", }, title: { type: "string", description: "Optional title for the notification. Should be brief (max 50 chars recommended). If omitted, only the message will be shown.", }, priority: { type: "string", enum: ["low", "normal", "high"], description: "Priority level for the notification. 'high' = urgent/critical alerts, 'normal' = standard updates (default), 'low' = non-urgent information.", }, payload: { type: "object", description: "Optional custom JSON payload for additional metadata. Can include any structured data that your app might process (e.g., action buttons, deep links, custom data).", } }, required: ["webhook_token", "message"], }, } ]; // Add channel management tools if device token is configured if (KWEENKL_DEVICE_TOKEN) { tools.push( { name: "kweenkl_list_channels", description: "List all your kweenkl notification channels with their webhook URLs. Use this to see what channels you have and get their webhook tokens.", inputSchema: { type: "object", properties: {}, required: [], }, }, { name: "kweenkl_create_channel", description: "Create a new kweenkl notification channel. Returns the channel details including the webhook URL that you can use to send notifications.", inputSchema: { type: "object", properties: { name: { type: "string", description: "Name for the new channel (e.g., 'Production Alerts', 'Daily Reports')", }, description: { type: "string", description: "Optional description of what this channel is for", }, color: { type: "string", description: "Optional hex color code for the channel (e.g., '#FF0000' for red). Default: #007AFF", }, icon: { type: "string", description: "Optional icon name for the channel. Default: 'bell'", } }, required: ["name"], }, }, { name: "kweenkl_update_channel", description: "Update a kweenkl channel's name, description, color, or icon. Use this to rename or modify existing channels.", inputSchema: { type: "object", properties: { channel_id: { type: "string", description: "The ID of the channel to update (get this from kweenkl_list_channels)", }, name: { type: "string", description: "New name for the channel", }, description: { type: "string", description: "New description for the channel", }, color: { type: "string", description: "New hex color code (e.g., '#FF0000')", }, icon: { type: "string", description: "New icon name", } }, required: ["channel_id"], }, }, { name: "kweenkl_delete_channel", description: "Delete a kweenkl notification channel. This permanently removes the channel and all its notifications. Use with caution!", inputSchema: { type: "object", properties: { channel_id: { type: "string", description: "The ID of the channel to delete (get this from kweenkl_list_channels)", } }, required: ["channel_id"], }, } ); } return { tools }; });