Skip to main content
Glama
Industrial-AIops Energy

Industrial-AIops Energy

diagnose_dataflow

Read-only

Diagnose no-data breaks across endpoint hops by probing connectivity, reads, freshness, and variance to separate connection failures, stale values, and flatlines, with a recommended fix.

Instructions

[READ][risk=low] Localize a 'no data' break across an endpoint's reachable hops.

Probes connect → read(ref) → freshness → variance and returns a verdict with
per-hop detail and a recommended action. The #1 OT triage: distinguishes
"cannot connect" (network/PLC down) from "comms OK but value stale"
(upstream/field/source) from "good status but flatline" (sensor stuck).

Args:
    endpoint: Endpoint name from config (any protocol).
    ref: Tag/node/address/device to read (OPC-UA node id, Modbus address,
        S7 address string, MELSEC device). Omit to test connectivity only.
    freshness_threshold_s: Max value-age (seconds) before 'stale' (default 60).
    series: Optional injected samples (scalars or {value,timestamp}) for
        flatline/variance reasoning when a live historian is out of reach.
    flatline_eps: Spread at/below which a series counts as flatline.

Returns dict: {verdict ('cannot_connect'|'comms_ok_value_unreadable'|
    'comms_ok_description_mismatch'|'comms_ok_bad_quality'|
    'comms_ok_value_stale'|'comms_ok_flatline'|'no_per_ref_read_in_this_build'|
    'no_connect_probe_in_this_build'|'healthy'), diagnosis,
    recommended_action, hops:[{hop, ok, detail}]}.
    'comms_ok_description_mismatch' means the sensor profile does not fit the
    device (wrong sensor fitted, other process-data layout, no profile): fix
    the configuration, not the field.

Example: diagnose_dataflow(endpoint="line1", ref="ns=2;i=5", freshness_threshold_s=30).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "diagnose_dataflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
seriesNo
endpointNo
flatline_epsNo
freshness_threshold_sNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.9

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already establish readOnlyHint=true, destructiveHint=false, and openWorldHint=true, but the description adds substantial behavioral detail: the exact probe sequence, per-hop output, recommended action, and explicit verdict values including build-limited outcomes like no_per_ref_read_in_this_build. It also explains what each major verdict means, such as description mismatch indicating a configuration problem rather than a field issue.

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 front-loaded with purpose and diagnostic sequence, then uses clear Args and Returns sections plus a compact example. Despite its length, every section earns its place by documenting non-obvious behavior, verdict semantics, and parameters that the schema leaves undocumented.

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?

For a complex five-parameter diagnostic tool with no output schema and zero schema description coverage, the description is complete: it covers purpose, usage, all parameters, return structure, verdict meanings, and an example. Nothing essential for correct invocation 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 carry all parameter meaning, and it does. It defines endpoint as any-protocol config name, ref with protocol-specific examples (OPC-UA node id, Modbus address, S7 address, MELSEC device), freshness_threshold_s with its default and stale meaning, series as optional injected samples with accepted shapes, and flatline_eps as the spread threshold for flatline detection.

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 gives a specific verb and resource: 'Localize a no-data break across an endpoint's reachable hops.' It further distinguishes the tool's role as a multi-hop dataflow triage, not just a connection check, and names the diagnostic stages it runs (connect → read → freshness → variance). This clearly differentiates it from single-purpose siblings like opcua_diagnose_connection or protocol-specific read tools.

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?

It states the primary use case explicitly (#1 OT triage for 'no data') and explains the diagnostic distinctions it makes, including the option to omit ref for connectivity-only tests. However, it does not explicitly name when to use a sibling tool instead, such as opcua_diagnose_connection for pure connection debugging or historian tools for historical retrieval.

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