Skip to main content
Glama

mqtt_read_messages

Read buffered MQTT messages from a subscribed topic, with wildcard support for multiple topics. Retrieves recent messages received since subscribing.

Instructions

Read buffered messages from a subscribed topic. Returns the most recent messages received since subscribing. Supports MQTT wildcards: '+' for single level, '#' for multi-level (e.g., 'sensors/#' returns messages from all topics under 'sensors/').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearNoWhether to clear the message buffer after reading. Default is false.
limitNoMaximum number of messages to return. Default is 10. Set to 0 or omit to return all messages.
topicNoThe MQTT topic to read messages from. Supports wildcards (+, #) to read from multiple matching topics. If not provided, returns messages from all subscribed topics.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose useful behavior: buffered (not live) retrieval, most-recent-first ordering, and wildcard expansion. It omits buffer capacity, eviction/retention behavior, and whether reads are non-destructive by default (that detail lives only in the schema's 'clear' param).

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?

Three tight sentences: core action first, then return semantics, then the wildcard capability. Zero filler and the most important fact leads.

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 read tool with no annotations and no output schema, the description stops short of what an agent needs: the structure of a returned message (topic, payload, timestamp) and the ordering of the returned array are unspecified. Buffer semantics are covered, but the response contract is not.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all three parameters including wildcard support and the clear/limit defaults. The description's wildcard sentence largely restates the topic schema description and adds no format or edge-case detail beyond it, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Read buffered messages from a subscribed topic') and characterizes the return set ('most recent messages received since subscribing'), which separates it functionally from siblings like mqtt_list_subscriptions. It never names a sibling to actively steer selection, so it falls short of a 5.

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

Usage Guidelines3/5

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

Usage is only implied: 'from a subscribed topic' and 'since subscribing' suggest a subscription must already exist, and reading buffered history implies this is the retrieval step after mqtt_subscribe. There is no explicit when-to-use/when-not statement and no guidance on choosing this over mqtt_list_subscriptions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.