Skip to main content
Glama
Industrial-AIops Energy

Industrial-AIops Energy

plc_program_outline

Read-only

Parse an exported PLC program file and return its block structure, variables, branches, timers/counters, and call graph with source-line citations for review and troubleshooting.

Instructions

[READ][risk=low] Structural outline of an EXPORTED PLC program file.

Parses one exported text file (Siemens SCL/ST .scl/.st, AWL/STL .awl,
Rockwell Studio 5000 .L5X — .txt is content-sniffed) and returns blocks
(FB/FC/OB/DB/routines/AOIs) with VAR sections, IF/CASE branch inventory,
timers/counters, and the call graph. Never uploads from a live PLC; reads
exactly the named file (≤5 MB). Every element cites source_file + line
(rung number for L5X ladder) — quote those citations when explaining.
Malformed sections degrade to entries in parse_errors, never a crash.

Args:
    path: Exported program file (.st/.scl/.awl/.l5x/.txt; must exist, ≤5 MB),
        under $IAIOPS_HOME, the config dir or an IAIOPS_AGENT_READ_DIRS dir.

Returns dict: {source_file, format, stats:{blocks, variables, call_edges,
    branches, timers_counters, comments, lines, parse_errors},
    blocks:[{name, kind, language, line, end_line, variables (≤100,
    variables_truncated), calls, branches, timers_counters, networks,
    comment}] (≤50, blocks_truncated), call_graph:[{caller, callee,
    source_file, line}], parse_errors, citation_note}.

Example: plc_program_outline(path="~/.iaiops/plc/Line3_Conveyor.scl").

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

Input Schema

NameRequiredDescriptionDefault
pathYes

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 only cover the read-only/safe profile; the description adds the substantive behaviors: 5 MB cap, path must resolve under $IAIOPS_HOME, the config dir, or an IAIOPS_AGENT_READ_DIRS dir, .txt content sniffing, and the degradation contract that malformed sections become parse_errors rather than a crash. It also discloses truncation limits (≤100 variables, ≤50 blocks) and the citation requirement, none of which are in the annotations.

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?

Front-loaded with a bracketed risk/read tag and the one-line purpose, then a scannable body, an Args block, a Returns block, and an example. Every section carries information an agent needs; nothing is padding.

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?

With no output schema, the description carries the full return contract and does so completely: top-level keys, stats sub-keys, block fields, truncation flags, call_graph shape, and citation_note. Combined with the error-degradation and path constraints, an agent can call this and interpret results without further lookup.

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 coverage is 0% and the single parameter is undocumented in schema, but the description fully compensates: accepted extensions (.st/.scl/.awl/.l5x/.txt), existence requirement, size limit, and the three allowed directory roots. This is meaning the schema cannot supply.

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?

States a specific verb and resource ('Structural outline of an EXPORTED PLC program file'), then enumerates exactly what is extracted (blocks, VAR sections, IF/CASE branches, timers/counters, call graph). It explicitly separates itself from live-PLC read tools by saying it 'Never uploads from a live PLC', which differentiates it from siblings like plc_program_section or the s7_/eip_ 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?

Clearly implies the use case: an offline, exported program file already on disk, with a stated file-size and directory constraint that determines when the call will succeed. It does not name concrete alternatives (e.g. plc_program_section for a single block), so the agent must infer the routing rather than being told it.

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