Skip to main content
Glama

Subscribe to PubNub Channel and Receive Messages

subscribe_and_receive_pubnub_messages

Subscribe to a PubNub channel to receive a configurable number of real-time messages within a specified timeout.

Instructions

Subscribe to a PubNub channel and receive messages in real-time. Specify the number of messages (default 1) and/or a timeout (default 10s, max 30s) to wait for. Requires publish and subscribe keys from your PubNub keyset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYesChannel ID to subscribe to and receive messages from
messageCountNoNumber of messages to wait for before unsubscribing (default: 1 message)
timeoutNoMaximum timeout in seconds. If not all messages are received within this time, the subscription will end (default: 10 seconds, max 30 seconds)
publishKeyYesPublish Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal
subscribeKeyYesSubscribe Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal
Behavior3/5

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

Without annotations, the description discloses the subscription behavior and defaults for messageCount and timeout. However, it does not explain blocking behavior, how messages are returned, or the unsubscription process.

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 three sentences with no fluff. It front-loads the main purpose and adds essential details efficiently.

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

Completeness4/5

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

With no output schema, the description does not explain the return format, which is a minor gap. However, for a real-time subscription tool, the return is somewhat implied. It covers all parameters and gives usage hints.

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?

Schema coverage is 100%, so baseline is 3. The description adds value by specifying default values for messageCount and timeout, max timeout, and the source for keys (manage_keysets tool), going beyond 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 'Subscribe to a PubNub channel and receive messages in real-time', providing a specific verb and resource. It distinguishes from sibling tools like get_pubnub_messages and send_pubnub_message.

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 mentions the prerequisite of publish and subscribe keys, which helps in usage context. However, it lacks explicit guidance on when to use this tool versus alternatives like get_pubnub_messages.

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

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