Skip to main content
Glama

Publish MQTT Message

emqx_publish

Publish MQTT messages to control devices or update Home Assistant entities. Set QoS, retain, and payload encoding to match your device requirements.

Instructions

Publish a single MQTT message through the broker.

This is how you drive a device or feed a Home Assistant MQTT entity. Publishing to a topic nobody subscribes to succeeds silently — check emqx_list_subscriptions if nothing reacts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qosNoMQTT QoS: 0, 1 or 2.
topicYesTarget topic, e.g. 'woow/test/switch/state'. Wildcards (+ and #) are not allowed when publishing.
retainNoKeep this as the topic's retained message, so new subscribers receive it on connect.
payloadYesMessage body, encoded per `payload_encoding`.
payload_encodingNoUse base64 for binary payloads.plain

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description discloses a critical non-obvious behavior: publishing to a topic with no subscribers succeeds silently, which is not evident from the annotations (readOnlyHint=false, destructiveHint=false). It also implies that a successful publish does not guarantee delivery, adding valuable context beyond the schema. This is a significant behavioral trait that helps the agent take appropriate follow-up actions.

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 concise and well-structured. It consists of two short paragraphs: the first states the purpose, and the second explains the use case and failure behavior. Every sentence earns its place, and the most critical information is front-loaded in the first sentence.

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

Completeness5/5

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

Given the presence of a detailed input schema (100% coverage), an output schema, and clear annotations, the description provides sufficient context. It explains the tool's primary use cases, a key failure mode (silent success), and a diagnostic pointer. This makes the description complete for an agent to select and invoke the tool effectively.

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?

The input schema already provides descriptions for all five parameters with 100% coverage. The description does not add parameter-level semantics beyond what the schema already states. Since the schema carries the full burden for parameter understanding, a baseline score of 3 is appropriate.

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 opens with 'Publish a single MQTT message through the broker', using a specific verb and resource. The word 'single' distinguishes it from the sibling emqx_publish_bulk. It also clarifies the intent with relatable use cases like driving a device or feeding a Home Assistant entity, making the purpose unmistakable.

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 gives clear context on when to use the tool: 'This is how you drive a device or feed a Home Assistant MQTT entity.' It also provides troubleshooting guidance ('check emqx_list_subscriptions if nothing reacts'). However, it does not explicitly state when not to use it or mention emqx_publish_bulk as an alternative for multiple messages, so it falls short of a perfect 5.

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/WOOWTECH/Woow_emqx_mcp_server'

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