Skip to main content
Glama
appricos

mcp-pushinator

by appricos

send-notification

Trigger push notifications to specific devices by sending a channel ID and content via the Pushinator API. Integrate into LLM workflows for real-time alerts.

Instructions

Send a notification via the Pushinator API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYesUUID of the channel to send the notification to
contentYesString content of the notification

Implementation Reference

  • The handler function for the 'send-notification' tool. It makes a POST request to the Pushinator API to send a notification with the given channel_id and content, then returns the response message.
    async ({ channel_id, content }) => {
        const notificationUrl = `${PUSHINATOR_API_BASE}/notifications/send/`;
    
        const response = await fetch(notificationUrl, {
            method: "POST",
            headers: {
                "Content-Type": "application/json",
                "User-Agent": USER_AGENT,
                "Authorization": `Bearer ${process.env.PUSHINATOR_API_KEY}`,
            },
            body: JSON.stringify({
                channel_id,
                content,
            }),
        });
    
    
        const responseData: PushinatorResponse = await response.json();
    
        return {
            content: [
                {
                    type: "text",
                    text: responseData.message,
                },
            ],
        };
    },
  • Zod input schema defining parameters for the 'send-notification' tool: channel_id (string UUID) and content (string).
    {
        channel_id: z.string().describe("UUID of the channel to send the notification to"),
        content: z.string().describe("String content of the notification"),
    },
  • src/index.ts:51-86 (registration)
    Registration of the 'send-notification' tool using server.tool(), specifying name, description, input schema, and handler function.
    server.tool(
        "send-notification",
        "Send a notification via the Pushinator API",
        {
            channel_id: z.string().describe("UUID of the channel to send the notification to"),
            content: z.string().describe("String content of the notification"),
        },
        async ({ channel_id, content }) => {
            const notificationUrl = `${PUSHINATOR_API_BASE}/notifications/send/`;
    
            const response = await fetch(notificationUrl, {
                method: "POST",
                headers: {
                    "Content-Type": "application/json",
                    "User-Agent": USER_AGENT,
                    "Authorization": `Bearer ${process.env.PUSHINATOR_API_KEY}`,
                },
                body: JSON.stringify({
                    channel_id,
                    content,
                }),
            });
    
    
            const responseData: PushinatorResponse = await response.json();
    
            return {
                content: [
                    {
                        type: "text",
                        text: responseData.message,
                    },
                ],
            };
        },
    );
  • TypeScript interface defining the expected response structure from the Pushinator API, used in the tool handler.
    interface PushinatorResponse {
        message: string;
        success: boolean;
    }
Install Server

Other Tools

Related 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/appricos/pushinator-mcp'

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