Skip to main content
Glama
industrial-aiops

OT-AIops Energy

plc_program_visibility

Read-only

Analyzes an exported PLC program to surface maintainability risks: documentation gaps, dead code, complexity hotspots, and risky constructs, plus a transparent risk score with cited reasons.

Instructions

[READ][risk=low] Maintainability / operational-risk profile of a legacy PLC program.

The "what am I inheriting?" view over one EXPORTED program (SCL/ST, AWL/STL,
Rockwell L5X): folds the structural outline into documentation coverage, the
least-commented blocks, blocks nothing references (possible dead code), the
complexity hotspots, risky constructs (unconditional JMPs, retentive RTO
timers, loops), and a TRANSPARENT additive risk score whose every point cites
its reason. Structural only — it anchors an engineer's review of a line
somebody else left behind, not a semantic understanding. Reads exactly the
named file (≤5 MB); never a live PLC upload. Every finding cites source_file +
line (rung number for L5X ladder).

Args:
    path: Exported program file (.st/.scl/.awl/.l5x/.txt; must exist, ≤5 MB).

Returns dict: {source_file, fmt, stats:{blocks, call_edges, line_count,
    comment_count, comment_ratio, variables, branches, timers_counters},
    documentation:{comment_ratio, band ('well_commented'|'sparse'|
    'undocumented'), uncommented_block_count, uncommented_blocks},
    entry_points:[{name, kind}], unreferenced_blocks:[{name, kind,
    source_file, line}], complexity_hotspots:[{block, kind, score, branches,
    calls, timers_counters, source_file, line}], risky_constructs:{
    unconditional_jumps, unconditional_jump_count, loops, loop_count,
    retentive_timers, retentive_timer_count}, risk:{score (0..100), band
    ('low'|'medium'|'high'), reasons[]}, parse_errors, note}.

Example: plc_program_visibility(path="~/exports/Line3_Conveyor.scl").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
Behavior5/5

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

Beyond the readOnlyHint and non-destructive annotations, the description discloses concrete behavioral traits: reads only the named file (≤5 MB), never performs live PLC uploads, every finding cites source_file+line, the risk score is transparent with cited reasons, and parse errors are reported. These details significantly aid the agent in predicting side effects and limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a bracketed [READ][risk=low] tag and a concise summary sentence, then expands into structured Args/Returns/Example sections. It is longer than average, but the detailed return dict is justified given the absence of an output schema. A slight trim could improve clarity, but every section serves a purpose.

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?

This is a complex analysis tool with one parameter and no output schema. The description provides a comprehensive return structure with nested fields, explains input constraints and behavioral limitations, and gives an example. It fully equips the agent to understand what the tool does, what it takes, and what it returns.

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?

The schema lists only a bare 'path' string with no description, so the description carries the full burden. It adds critical semantics: acceptable file extensions (.st/.scl/.awl/.l5x/.txt), existence requirement, and the ≤5 MB size limit, plus an example. This fully compensates for the 0% schema coverage.

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 clearly states the tool's purpose: producing a maintainability/operational-risk profile for an exported PLC program, with specific outputs like documentation coverage, unreferenced blocks, complexity hotspots, and risky constructs. This goes beyond a generic verb+resource and distinguishes it from sibling tools like plc_program_outline or plc_program_xref.

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 provides strong contextual cues: it is the 'what am I inheriting?' view for reviewing legacy code, works on exported files only, and explicitly excludes semantic understanding and live PLC uploads. It implies when to use (risk assessment of static files) and when not (live data or semantic analysis), though it does not name specific alternative tools.

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/industrial-aiops/industrial-aiops-energy'

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