Skip to main content
Glama
bunkerapps

Superprecio MCP Server

by bunkerapps

subscribe_device

Register a device to receive price drop alerts, special deal notifications, and promotional messages from Superprecio's price comparison service.

Instructions

Subscribe a device to receive push notifications about deals and price alerts.

This tool registers a device token with the Superprecio notification system. Once subscribed, devices will receive:

  • Price drop alerts

  • Special deal notifications

  • New product announcements

  • Custom promotional messages

Note: Requires a valid Firebase Cloud Messaging device token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceTokenYesFirebase Cloud Messaging device token

Implementation Reference

  • The main handler function that executes the subscribe_device tool logic. It validates arguments, calls the API client's subscribeDevice method, formats success/error responses.
    export async function executeSubscribeDevice(
      client: SuperPrecioApiClient,
      args: { deviceToken: string }
    ) {
      if (!args) {
        throw new Error('Missing required arguments');
      }
    
      const { deviceToken } = args;
    
      try {
        const result = await client.subscribeDevice(deviceToken);
    
        return {
          content: [
            {
              type: 'text',
              text: `Device subscribed successfully!\n\nYou will now receive notifications about:\n- Price drops\n- Special deals\n- New products\n- Promotional offers\n\nDevice Token: ${deviceToken.substring(0, 20)}...\n\nResult: ${JSON.stringify(result, null, 2)}`,
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to subscribe device: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Tool definition including name, description, and input schema for validation.
    export const subscribeDeviceTool = {
      name: 'subscribe_device',
      description: `Subscribe a device to receive push notifications about deals and price alerts.
    
    This tool registers a device token with the Superprecio notification system.
    Once subscribed, devices will receive:
    - Price drop alerts
    - Special deal notifications
    - New product announcements
    - Custom promotional messages
    
    Note: Requires a valid Firebase Cloud Messaging device token.`,
      inputSchema: {
        type: 'object',
        properties: {
          deviceToken: {
            type: 'string',
            description: 'Firebase Cloud Messaging device token',
          },
        },
        required: ['deviceToken'],
      },
    };
  • src/index.ts:140-141 (registration)
    Registration in the tool execution switch statement in the MCP server.
    case 'subscribe_device':
      return await executeSubscribeDevice(apiClient, args as any);
  • src/index.ts:98-98 (registration)
    Inclusion of the tool in the listTools response.
    subscribeDeviceTool,
  • API client method that performs the actual HTTP POST to subscribe the device token.
    async subscribeDevice(token: string): Promise<any> {
      try {
        const response = await this.client.post('/devices/suscribe', { token });
        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 clearly indicates this is a registration/mutation operation (implied by 'subscribe' and 'registers'), describes what happens after subscription (types of notifications received), and mentions the authentication requirement (Firebase token). However, it doesn't cover important behavioral aspects like whether the subscription is persistent, if there are rate limits, or what happens on duplicate subscriptions.

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 perfectly structured and front-loaded with the core purpose in the first sentence. Each subsequent sentence adds valuable information about what notifications will be received and the token requirement. There's zero wasted text, and the bulleted list efficiently communicates the notification types without unnecessary elaboration.

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 mutation tool with no annotations and no output schema, the description does a reasonable job covering the basic operation and requirements. However, it lacks information about the return value (success/failure indicators, subscription ID), error conditions, or persistence details that would be important for an agent to use this tool effectively in production scenarios.

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 for its single parameter, so the baseline is 3. The description adds meaningful context by explaining that the deviceToken parameter must be a 'valid Firebase Cloud Messaging device token' and connects it to the notification system registration, providing additional semantic understanding beyond the schema's technical specification.

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 specific action ('Subscribe a device') and resource ('to receive push notifications about deals and price alerts'), distinguishing it from sibling tools like 'set_price_alert' or 'send_notification' which handle different notification-related functions. It explicitly defines the scope of notifications the device will receive.

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 for when to use this tool (registering a device for notifications) and includes a prerequisite note about requiring a valid Firebase token. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools for similar notification-related tasks.

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