Skip to main content
Glama

send_notification

Deliver weather alerts and updates directly to macOS users through native system notifications, providing timely information on temperature, conditions, humidity, wind speed, and atmospheric pressure.

Instructions

Send a macOS notification with provided weather data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesNotification message
titleYesNotification title

Implementation Reference

  • The main handler function for the send_notification tool. It executes an AppleScript via child_process to display a macOS notification dialog with the provided title and message, handling success and error responses.
    async sendNotification(title, message) { try { const { exec } = await import('child_process'); const { promisify } = await import('util'); const execAsync = promisify(exec); const combinedMessage = `${title}\\n\\n${message}`; const script = `osascript -e 'tell application "System Events" to display dialog "${combinedMessage}" with title "Weather Update" buttons {"OK"} default button "OK" giving up after 10'`; console.error("Executing:", script); await execAsync(script); return { content: [ { type: "text", text: `✅ Weather dialog displayed!\nTitle: ${title}\nMessage: ${message}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `❌ Failed: ${error.message}`, }, ], }; } }
  • index.js:48-65 (registration)
    Registration of the send_notification tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    { name: "send_notification", description: "Send a macOS notification with provided weather data", inputSchema: { type: "object", properties: { title: { type: "string", description: "Notification title", }, message: { type: "string", description: "Notification message", }, }, required: ["title", "message"], }, },
  • index.js:77-79 (handler)
    Dispatch handler in CallToolRequestSchema that routes calls to the send_notification tool by invoking the sendNotification method.
    if (name === "send_notification") { return await this.sendNotification(args.title, args.message); }
  • Input schema definition for the send_notification tool, specifying title and message as required strings.
    inputSchema: { type: "object", properties: { title: { type: "string", description: "Notification title", }, message: { type: "string", description: "Notification message", }, }, required: ["title", "message"], },

Other Tools

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/shtansky-bikeleasing/weather-mcp-server'

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