Skip to main content
Glama

PubNub MCP Server

by pubnub

pubnub_subscribe_and_receive_messages

Subscribe to a PubNub channel, receive a specified number of messages, and automatically unsubscribe. Use to listen for messages on a channel, with an optional timeout to control the waiting period.

Instructions

Subscribes to a PubNub channel and waits to receive a specified number of messages, then automatically unsubscribes. Call this tool when you need to listen for messages on a channel. Optionally specify a timeout in milliseconds to avoid waiting indefinitely.

Input Schema

NameRequiredDescriptionDefault
channelYesName of the PubNub channel to subscribe to and receive messages from
messageCountNoNumber of messages to wait for before unsubscribing (default: 1)
timeoutNoOptional timeout in milliseconds. If not all messages are received within this time, the subscription will end (default: no timeout)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "channel": { "description": "Name of the PubNub channel to subscribe to and receive messages from", "type": "string" }, "messageCount": { "default": 1, "description": "Number of messages to wait for before unsubscribing (default: 1)", "type": "number" }, "timeout": { "description": "Optional timeout in milliseconds. If not all messages are received within this time, the subscription will end (default: no timeout)", "type": "number" } }, "required": [ "channel" ], "type": "object" }

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/pubnub/pubnub-mcp-server'

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