mcpMQTT provides 4 MQTT-focused tools with reasonable descriptions and parameter schemas. All tools are explicitly registered with @mcp.tool decorators and include annotations. However, there are notable gaps: descriptions lack concrete guidance on when to use each tool vs alternatives (mqtt_read vs mqtt_subscribe ambiguity), error handling is minimal (tools return plain text error strings rather than structured recovery guidance), output schemas are mostly undocumented (mqtt_subscribe returns JSON but its structure is inferred, not formally declared), and parameter validation/constraint documentation is sparse. The tool naming is verb-forward and clear (mqtt_publish, mqtt_subscribe, mqtt_read, mqtt_query), but the descriptions don't sufficiently distinguish similar tools or explain dependencies. Parameter descriptions exist but are brief (10-40 chars) and lack constraint details (e.g., what QoS levels are valid, what timeout ranges are sensible). Security checks are present (topic permission validation) but not documented in the tool descriptions. Output formatting varies: mqtt_publish and mqtt_read return plain strings, mqtt_subscribe returns JSON, inconsistency forces the LLM to parse mixed response types.
Publish a message to an MQTT topic.
Subscribe to a response_topic, publish a message to a request_topic with a specified payload as query and wait for a response. Return the first message received. If no message is returned until timeout, no message is returned
Subscribe to a topic and return the first message received. If not message is returned until timeout, no message is returned
Subscribe to a topic and return messages received during a given time if time expires or max_messages number of messages are reached.
Ambiguous tool differentiation: mqtt_read and mqtt_subscribe are nearly identical in purpose (both subscribe and return messages), but descriptions do not explain when an LLM should choose one over the other. mqtt_read is for single messages; mqtt_subscribe is for multiple. LLM reasoning will conflate them.
Output schemas are not formally documented. mqtt_subscribe returns JSON with 'topic', 'messages_received', 'messages' fields, but this structure is inferred from code, not declared in tool schema. mqtt_publish, mqtt_read, and mqtt_query return plain strings. Inconsistent response types force LLMs to parse mixed formats.
Parameter constraints underdocumented. 'qos' accepts 0, 1, or 2 but no enum constraint. 'timeout' and 'max_messages' lack min/max bounds. Descriptions do not specify what happens if constraints are violated (e.g., qos=5, timeout=-1). Forces LLMs to guess valid ranges.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 56 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 26 | - | v1 |
Error handling provides no recovery guidance. Tools return plain error strings ('Error: No read permission', 'Failed to subscribe') with no hint on what the LLM should do next. Pattern recovery-guide requires errors to suggest next steps.
Parameter descriptions are too brief (5 - 40 chars) and lack actionable detail. E.g., 'Timeout in seconds' does not say whether it applies to subscription, message wait, or both. Does 'topic pattern' in mqtt_subscribe mean regex? Wildcard? Exact match? LLM must infer.
Permission checks (topic read/write validation) are implemented in code but not documented in tool descriptions. LLM has no visibility into which topics are allowed, what format topic names must follow, or how to handle permission denial beyond the error message.
mqtt_publish and mqtt_query both publish messages but serve different purposes (one-way vs request-response). Descriptions do not guide the LLM to choose based on use case. This violates the composition principle: when multiple tools operate on the same resource (MQTT publish), their distinctions must be obvious.