Skip to main content
Glama

mqtt_subscribe

Subscribe to MQTT topics to receive messages with configurable limits and timeout settings for monitoring IoT data streams.

Instructions

Subscribes to an MQTT topic and receives a specified number of messages or waits for a timeout.

Args:
    topic: The MQTT topic to subscribe to (can include wildcards like + or #).
    num_messages: The maximum number of messages to receive. Defaults to 1.
    timeout: The maximum time (in seconds) to wait for messages. Defaults to 10.

Returns:
    A list of dictionaries, where each dictionary represents a received message
    with 'topic' and 'payload' keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
num_messagesNo
timeoutNo
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 explains the subscription behavior, message collection, and timeout mechanism, but lacks details about connection requirements, error handling, or what happens if no messages arrive. It provides basic operational context but misses important behavioral aspects.

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 with a clear opening sentence followed by well-organized Args and Returns sections. Every sentence earns its place by providing essential information without redundancy. The formatting enhances readability while maintaining brevity.

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?

Given the tool's moderate complexity (3 parameters, no annotations, no output schema), the description covers the basic operation and parameters well but lacks information about connection state, authentication requirements, error conditions, and the format of the returned payload. It's adequate for basic use but incomplete for robust implementation.

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

Parameters5/5

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

The schema description coverage is 0%, so the description must fully compensate. It provides detailed semantic information for all three parameters: explains topic wildcards (+ and #), clarifies num_messages as a maximum with default, and specifies timeout units (seconds) with default. This adds significant value beyond the bare 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 specific action ('Subscribes to an MQTT topic') and resource ('receives a specified number of messages or waits for a timeout'), distinguishing it from the sibling tool mqtt_publish. It provides a complete picture of what the tool does beyond just the verb.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like mqtt_publish, nor does it mention prerequisites, error conditions, or typical use cases. It only describes what the tool does without contextual usage information.

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/Omniscience-Labs/OMNI-MQTT-MCP'

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