Skip to main content
Glama

mqtt_publish

Publish messages to MQTT topics with configurable QoS and retention settings for IoT and messaging applications.

Instructions

Publishes a message to a specific MQTT topic.

Args:
    topic: The MQTT topic to publish to.
    message: The message payload to send.
    qos: The Quality of Service level (0, 1, or 2). Defaults to 0.
    retain: Whether the message should be retained by the broker. Defaults to False.

Returns:
    A confirmation message string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
messageYes
qosNo
retainNo
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the basic action (publishing) and return value (confirmation message), but lacks critical behavioral details like authentication requirements, error handling, network behavior, or what happens if the broker is unavailable. For a network operation with potential side effects, this is insufficient transparency.

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 and concise: a clear purpose statement followed by well-organized parameter documentation with defaults indicated. Every sentence adds value with no redundancy or unnecessary information. The Args/Returns format makes it easy to parse while maintaining readability.

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 (network operation with 4 parameters) and complete lack of annotations/output schema, the description does an adequate job covering the basics but has significant gaps. It explains parameters well and states the return type, but misses critical behavioral context about authentication, error conditions, and MQTT-specific behaviors that would help an agent use it correctly.

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

Parameters4/5

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

The description adds significant value beyond the schema, which has 0% description coverage. It explains each parameter's purpose: 'topic' as the destination, 'message' as the payload, 'qos' with valid values (0,1,2) and default, and 'retain' with meaning and default. This compensates well for the schema's lack of descriptions, though it could provide more context about QoS implications.

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 clearly states the action ('Publishes a message') and target resource ('to a specific MQTT topic'), making the purpose immediately understandable. It distinguishes from the sibling 'mqtt_subscribe' by specifying the opposite operation (publish vs subscribe). However, it doesn't explicitly mention what makes this tool unique beyond the basic verb, so it falls short of a perfect 5.

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 or in what context it should be applied. While the sibling tool 'mqtt_subscribe' exists, there's no explicit comparison or recommendation about choosing between publish and subscribe operations. This leaves the agent without usage context beyond the basic purpose.

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