Skip to main content
Glama
KphungFROMM

motionworks-iec-mcp-server

by KphungFROMM

get_pou

Retrieve a complete POU with interface, body, and network details from MotionWorks IEC projects. Returns original Structured Text source, compact ladder/FBD representations, and supports paging for long bodies.

Instructions

Get one POU: its interface, its body, and every network it contains.

This is the workhorse tool. Structured Text is returned as the original source, tab alignment and inline comments intact. Ladder and FBD bodies are returned as one compact text line per network plus a structured nets array naming each block, its instance and each formal parameter's source — the equivalent of NeutralText for Studio 5000, and far smaller than the raw XML.

Long bodies are paged: check body.truncated and pass offset to continue.

Args: path: Project file or directory. pou_name: POU name exactly as reported by get_pous. offset: Line offset into the body, for paging long POUs. include_interface: Include the declared variables for each scope. include_outputs: For graphical bodies, include each block's output pins.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
offsetNo
pou_nameYes
include_outputsNo
include_interfaceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden, and it delivers: it discloses exact return behavior for Structured Text (original source, tab alignment, inline comments), the compact text-plus-nets representation for Ladder/FBD, paging via body.truncated and offset, and output-size tradeoffs relative to raw XML. This is far richer than a generic 'Get one POU.'

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 the primary purpose, then adds high-value behavioral details, then lists parameters in an Args block. Every sentence contributes: source fidelity, network representation, paging, and param semantics. It is long but dense and well-organized, not padded.

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?

Given the tool's complexity, an output schema exists, and the description covers behavior, paging, param meanings, and the relationship to get_pous, the definition is complete for an agent to select and invoke the tool correctly. No critical operational detail appears to be 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 explain all parameters, and it does: path as project file or directory, pou_name as exact name from get_pous, offset as line paging, include_interface as per-scope variables, and include_outputs as graphical block output pins. This adds real meaning beyond the bare schema types.

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 opens with a specific verb and resource: 'Get one POU: its interface, its body, and every network it contains.' It clearly distinguishes this from the plural sibling get_pous by emphasizing a single POU, and it names concrete content areas rather than merely restating the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'This is the workhorse tool' implies broad/default usage, and the instruction that pou_name must be 'exactly as reported by get_pous' hints at a prior step. However, there is no explicit guidance about when to prefer this tool over get_routine, render_pou_source, or validate_pou, nor any when-not-to-use conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.