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
Name | Required | Description | Default |
---|---|---|---|
channel | Yes | Name of the PubNub channel to subscribe to and receive messages from | |
messageCount | No | Number of messages to wait for before unsubscribing (default: 1) | |
timeout | No | Optional 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"
}