Skip to main content
Glama
shtansky-bikeleasing

Weather MCP Server

send_notification

Delivers weather alerts as macOS notifications by sending provided weather data directly to the user's desktop for immediate awareness.

Instructions

Send a macOS notification with provided weather data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesNotification title
messageYesNotification message

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 given title and message.
    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)
    Tool registration in the ListTools response, defining the name, description, and input schema for 'send_notification'.
    {
        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 logic in the CallToolRequest handler that routes calls to 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"],
    },
Install Server

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