Skip to main content
Glama
KonnectSuite

studio5000-mcp-server

by KonnectSuite

get_routine

Retrieve PLC routine logic from an L5X file by program and routine name, returning ladder rungs as compact NeutralText with comments or raw Structured Text.

Instructions

Get routine logic — NeutralText for ladder, raw code for Structured Text.

Ladder rungs are returned as compact NeutralText with rung comments, not raw XML. A single rung like 'XIC Motor_Start XIO Motor_Fault OTE Motor_Run' replaces hundreds of lines of verbose XML.

Args: l5x_path: Path to a .l5x file. program: Program name containing the routine. routine_name: Routine name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
programYes
l5x_pathYes
routine_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does disclose a genuinely non-obvious behavioral trait: ladder logic is returned as compact NeutralText with rung comments rather than raw XML. It omits error behavior (e.g., routine not found) and permission/file-access expectations, keeping it short of a 5.

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 core purpose is front-loaded in the first line, and the NeutralText explanation earns its place by preempting confusion about the return format. The XML-comparison example is slightly verbose but justifies the design rather than padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and all three required parameters are at least named in the description. The main gaps are error handling and routing versus sibling read tools, which are minor for a simple getter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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 compensate; it lists all three parameters and clarifies l5x_path is a path to a .l5x file and program is the containing program. However, it adds no format, constraint, or naming-convention detail beyond the parameter names themselves.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb ('Get') plus resource ('routine') with an explicit statement of what is returned: NeutralText for ladder, raw code for Structured Text. It does not explicitly distinguish itself from the sibling get_routines (plural), leaving the single-vs-list distinction to be inferred from the name.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus get_routines, search_logic, or get_aoi. The description never states the conditions or context in which retrieving a single routine is the right call.

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