Skip to main content
Glama
bunkerapps

Superprecio MCP Server

by bunkerapps

send_notification

Send push notifications to specific devices or broadcast alerts to all users for price drops, deals, and important updates using Firebase Cloud Messaging.

Instructions

Send a push notification to a specific device or broadcast to all subscribed devices.

This tool can:

  • Send personalized notifications to specific devices

  • Broadcast alerts to all users

  • Include custom data (like product links, images, etc.)

  • Notify about price drops, deals, or important updates

Note: Requires Firebase Cloud Messaging setup on the Superprecio server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesNotification title
messageYesNotification body/message
deviceTokenNoOptional: specific device token to send to. If not provided, broadcasts to all devices.
dataNoOptional: additional data to include (e.g., product URL, image URL)

Implementation Reference

  • Core handler function that implements the send_notification tool logic. Handles input validation, conditional API calls for targeted or broadcast notifications, response formatting, and error handling.
    export async function executeSendNotification(
      client: SuperPrecioApiClient,
      args: {
        title: string;
        message: string;
        deviceToken?: string;
        data?: Record<string, any>;
      }
    ) {
      if (!args) {
        throw new Error('Missing required arguments');
      }
    
      const { title, message, deviceToken, data } = args;
    
      try {
        let result;
    
        if (deviceToken) {
          // Send to specific device
          result = await client.sendNotification({
            token: deviceToken,
            title,
            body: message,
            data,
          });
    
          return {
            content: [
              {
                type: 'text',
                text: `Notification sent successfully to device!\n\nTitle: ${title}\nMessage: ${message}`,
              },
            ],
          };
        } else {
          // Broadcast to all devices
          result = await client.broadcastNotification({
            title,
            body: message,
            data,
          });
    
          return {
            content: [
              {
                type: 'text',
                text: `Notification broadcast successfully to all devices!\n\nTitle: ${title}\nMessage: ${message}\n\nResult: ${JSON.stringify(result, null, 2)}`,
              },
            ],
          };
        }
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to send notification: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Defines the tool metadata, description, and input schema for validation of send_notification parameters.
    export const sendNotificationTool = {
      name: 'send_notification',
      description: `Send a push notification to a specific device or broadcast to all subscribed devices.
    
    This tool can:
    - Send personalized notifications to specific devices
    - Broadcast alerts to all users
    - Include custom data (like product links, images, etc.)
    - Notify about price drops, deals, or important updates
    
    Note: Requires Firebase Cloud Messaging setup on the Superprecio server.`,
      inputSchema: {
        type: 'object',
        properties: {
          title: {
            type: 'string',
            description: 'Notification title',
          },
          message: {
            type: 'string',
            description: 'Notification body/message',
          },
          deviceToken: {
            type: 'string',
            description: 'Optional: specific device token to send to. If not provided, broadcasts to all devices.',
          },
          data: {
            type: 'object',
            description: 'Optional: additional data to include (e.g., product URL, image URL)',
          },
        },
        required: ['title', 'message'],
      },
    };
  • src/index.ts:97-97 (registration)
    Registration of sendNotificationTool in the array of tools returned by the MCP listTools handler.
    sendNotificationTool,
  • src/index.ts:137-138 (registration)
    Dispatch/execution routing for the send_notification tool in the MCP callTool request handler.
    case 'send_notification':
      return await executeSendNotification(apiClient, args as any);
  • Underlying API client method for sending notifications to a specific device token, called by the tool handler.
    async sendNotification(data: {
      token: string;
      title: string;
      body: string;
      data?: Record<string, any>;
    }): Promise<any> {
      try {
        const response = await this.client.post('/notifications/send', data);
        return response.data;
      } catch (error) {
        throw this.handleError(error);
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by mentioning the Firebase setup requirement and describing broadcast vs targeted delivery modes. However, it lacks details about rate limits, error conditions, authentication needs, or what happens when deviceToken is invalid - important for a notification tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. The first sentence states the core purpose, followed by a bulleted list of capabilities, and ends with an important prerequisite note. Every sentence adds value with no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a notification tool with 4 parameters, no annotations, and no output schema, the description is adequate but has gaps. It covers the main purpose and usage context well, but lacks information about return values, error handling, or detailed behavioral constraints that would be important for reliable tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, so the baseline is 3. The description adds value by explaining the semantic meaning of parameters: deviceToken determines targeted vs broadcast delivery, and data can include product links/images. It also clarifies that title and message are required, though this is already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('send', 'broadcast') and resources ('push notification', 'device', 'subscribed devices'). It distinguishes this tool from siblings like 'subscribe_device' or 'set_price_alert' by focusing on notification delivery rather than subscription or alert creation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool (for sending notifications with custom data about deals/updates) and mentions the Firebase Cloud Messaging prerequisite. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/bunkerapps/superprecio_mcp'

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