Skip to main content
Glama

Subscribe and collect messages

subscribe
Read-only

Collects messages from an MQTT topic filter for a few seconds and returns them, enabling live device traffic inspection and current sensor readings.

Instructions

Subscribe to an MQTT topic filter and collect incoming messages for a few seconds, then return them. Good for watching live device traffic, e.g. 'what is the living room sensor sending right now?'.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "filter": "<filter>"
    },
    "name": "subscribe"
  }
}

Input Schema

NameRequiredDescriptionDefault
filterYesMQTT topic filter, wildcards + and # allowed
maxMessagesNoStop early after this many messages
durationSecondsNoHow long to listen, in seconds

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true; the description adds the important behavioral fact that the call is time-bounded — it collects 'for a few seconds, then return them' — implying a blocking wait with no persistence. It omits what happens when nothing is published during the window and the shape of returned messages, so it is good but not complete.

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?

Two short sentences, behavior first and the motivating example second, with no filler or redundant restatement of schema fields.

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?

For a three-parameter, non-destructive read tool with full schema coverage, the description covers purpose, typical use, and the bounded listen-and-return model. The remaining gap — output message format and ordering — is modest given no output schema exists, but it is a real gap for a tool whose whole point is returning data.

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 coverage is 100%, with filter, maxMessages, and durationSeconds all documented including wildcard support and bounds, so the schema does the heavy lifting. The description only loosely echoes the duration ('a few seconds') and adds no new semantics such as wildcard examples or how maxMessages interacts with the timeout.

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 ('Subscribe to an MQTT topic filter') plus the collect-then-return behavior, which is far more than a restatement of the name. It does not explicitly contrast with the publish sibling, but the read-only framing and the 'watching live traffic' example make the direction of data flow unambiguous.

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?

It supplies a concrete when-to-use case ('watching live device traffic, e.g. what is the living room sensor sending right now') that tells an agent what question this tool answers. No exclusions or named alternatives are given, so it stops short of full routing guidance.

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

Deploy Server

Other Tools