plc_program_outline
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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |