Skip to main content
Glama
Industrial-AIops Energy

Industrial-AIops Energy

uns_publish

Publishes already-read normalized numeric points to an MQTT broker or UNS, nesting dotted metrics into browsable topic levels and skipping non-numeric values.

Instructions

[READ][risk=low] Publish already-read normalized points to an MQTT broker / UNS.

Egress of data the agent already READ — NOT a control write. Each numeric point becomes a JSON
message on ``<topic_prefix>/<metric>``, with a dotted metric nested into topic levels
(``line1.temp`` -> ``plant/line1/temp``) so a Unified Namespace stays browsable. Non-numeric
points are skipped (use a historian sink for text/state). The topic is always derived from
``topic_prefix`` — it is never taken verbatim, so this cannot address a command topic. Needs the
extra: pip install iaiops[mqtt].

Args:
    points: Collected point dicts (e.g. from *_read_many): {ref/metric, value, timestamp, ...}.
    topic_prefix: Root of the topic tree (default 'iaiops'); wildcards are stripped.
    host: Broker hostname or IP (default localhost).
    port: Broker port; 0 picks 8883 with TLS else 1883.
    username: Optional broker username.
    password: Optional broker password.
    use_tls: Use TLS to the broker.
    qos: MQTT QoS 0/1/2 (default 0, fire-and-forget); values outside 0-2 are clamped.
    retain: Ask the broker to retain the last value per topic (useful for a UNS).

Returns dict: {publisher, topic_prefix, broker, received, published, skipped_non_numeric}.

Example: uns_publish(points=[{"ref": "line1.temp", "value": 21.5}], topic_prefix="plant",
    host="10.0.0.5").

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

Input Schema

NameRequiredDescriptionDefault
qosNo
hostNolocalhost
portNo
pointsYes
retainNo
use_tlsNo
passwordNo
usernameNo
topic_prefixNoiaiops

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.13

TDQS

A5/5.0
Behavior5/5

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

The description discloses rich behavioral detail beyond the annotations: dotted-metric topic nesting, non-numeric point skipping, derived topic prefix with wildcard stripping, QoS clamping, port/TLS auto-selection, and the exact return dictionary. Annotations are minimal and safe (destructiveHint false), so the description carries and fully satisfies the burden. There is no contradiction with readOnlyHint=false because the publication is a side-effect write, while '[READ]' refers to source data already read.

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 long but every section earns its place: a purpose statement, safety clarification, behavioral details, a structured parameter list, return type, and a concrete example. It is front-loaded with the core purpose and risk tag before diving into details, and the formatting makes it easy to scan.

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 9 parameters, no output schema, and no parameter descriptions in the schema, the description is remarkably complete. It defines the return dict, covers edge cases (non-numeric skip, wildcard stripping, QoS clamping), mentions the installation prerequisite, provides an example, and clarifies the safety profile. Nothing an agent needs to call this tool correctly is missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully explain each of the 9 parameters. It does: points, topic_prefix, host, port, username, password, use_tls, qos, and retain, each with defaults, meaning, and behavioral notes (e.g., 'wildcards are stripped', 'values outside 0-2 are clamped'). This comprehensively compensates for the schema gap.

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 states a specific action: 'Publish already-read normalized points to an MQTT broker / UNS.' It clearly defines the resource (numeric points) and differentiates from control-write tools by noting 'NOT a control write' and from historian sinks for non-numeric data. This makes its purpose unambiguous and distinguishable from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says when to use: to egress data the agent has already read. It gives when-not guidance: 'Non-numeric points are skipped (use a historian sink for text/state)' and 'cannot address a command topic.' It also mentions the prerequisite pip install, leaving no ambiguity about invocation context.

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