Skip to main content
Glama
industrial-aiops

OT-AIops Energy

plc_program_section

Read-only

Fetches the exact source text of a named block (FB/FC/OB/DB or routine) from an exported PLC program file, returning up to 200 lines and a truncation flag for accurate section review.

Instructions

[READ][risk=low] Source text of ONE named block from an exported program.

Returns the exact source of a single block (FB/FC/OB/DB name for SCL/AWL;
Program.Routine or routine name for L5X — rungs are rendered as
'[rung N] ...'), capped at 200 lines with an explicit truncated flag, so
the agent reads exactly the section it is explaining instead of guessing.
Unknown block names fail with the list of available blocks.

Args:
    path: Exported program file (.st/.scl/.awl/.l5x/.txt; must exist, ≤5 MB).
    block: Block/routine name (case-insensitive; quotes optional).

Returns dict: {source_file, format, block, kind, start_line, end_line,
    lines_returned, truncated, source, parse_errors}.

Example: plc_program_section(path="~/exports/Line3.scl", block="FB_Conveyor").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
blockYes
Behavior5/5

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

Beyond the readOnlyHint and destructiveHint annotations, the description discloses specific behavior: 200-line cap with a truncated flag, case-insensitive block names, list of available blocks on failure, and the exact return dictionary keys. This adds substantial transparency.

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 well-structured with a summary, args, returns, and an example. Every sentence adds value and is concise, making it easy for an agent to parse quickly.

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?

The description is complete: it covers input constraints, output structure (including all return keys), failure behavior, and a practical example. Even without an output schema, the agent knows exactly what to expect.

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?

Since the schema provides no parameter descriptions, the description fully compensates by detailing path (file extensions, existence, ≤5 MB) and block (case-insensitive, quotes optional). This is essential for correct invocation.

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: returning the exact source text of a single named block from an exported program. It distinguishes itself from sibling tools like plc_program_outline (outline) and plc_program_xref (cross-reference) by focusing on raw source retrieval.

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 clear context: it is for reading exactly the section the agent is explaining, capping at 200 lines, and failing unknown blocks with a list. However, it does not explicitly state when to use this tool instead of alternative siblings (e.g., outline for overview), so it stops short of a 5.

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