Skip to main content
Glama

连接 MQTT Broker

mqtt_connect

Establishes a named connection using saved MQTT broker configuration and reuses it when already connected.

Instructions

使用已保存的配置建立一个命名连接。若已连接则直接复用。

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": {
      "name": "<name>"
    },
    "name": "mqtt_connect"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes连接名称

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses two important behavioral traits: it draws on a saved configuration rather than ad-hoc parameters, and it is idempotent because an existing connection is reused. It says nothing about what happens when the name does not match a saved configuration, whether the call blocks on network timeouts, or how long the connection persists.

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, with the core action and the prerequisite condition front-loaded and the reuse behavior following. There is no redundant restatement of the tool name or title, and every clause carries information.

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 one-parameter tool with no output schema and no annotations, the description covers purpose, prerequisite source of configuration, and idempotency. The remaining gaps are error handling for an unknown name and connection lifetime, which are secondary but non-trivial for a network operation.

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?

There is only one parameter, and both the schema description ("连接名称") and schema coverage (100%) already document it. The description adds a modest amount of meaning by implying that this name refers to an entry in the saved configuration rather than to an arbitrary broker address. That is a small gain, so the baseline score of 3 is appropriate.

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 states a specific verb and resource: it establishes a named connection using a saved configuration. The phrase "使用已保存的配置" implicitly distinguishes this from mqtt_configure (which presumably creates that saved configuration), so an agent can tell the setup step from the connect step. It does not name any sibling explicitly, so it stops short of full differentiation.

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?

The prerequisite that a saved configuration must already exist is only implied. The reuse clause ("若已连接则直接复用") tells the agent that calling this tool again is harmless, which is useful guidance. There is no explicit statement of when to prefer this over mqtt_configure, mqtt_connections, or mqtt_disconnect.

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