Skip to main content
Glama
apexsotjo-blip

control-expert-mcp

write_st_logic

Write or replace IEC 61131-3 Structured Text logic for a program section. Optionally declare variables, then run build_project to fix errors.

Instructions

Write a program section in plain IEC 61131-3 Structured Text — no XML required. Creates the section or replaces its logic if it exists.

st_source is raw ST (IF/CASE/FOR, FB calls like 'T1(IN := x, PT := t#3s, Q => y);', set()/reset() on EBOOLs, re()/fe() edges). declare optionally declares variables as a comma-separated 'name:TYPE' list, e.g. 'StartPB:BOOL, Delay1:TON, Level:REAL' — FB instances called in the code (TON/TOF/CTU/DFB types) must exist or be declared here. Run build_project afterwards and fix any errors from its output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYes
sectionYes
st_sourceYes
declareNo
Behavior4/5

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

With no annotations, the description carries full burden. It explains the tool creates or replaces section logic, describes the syntax of st_source and the declare parameter, and notes that FB instances must be declared. This adds valuable behavioral context, though it omits details like permissions or error states.

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 description is a single paragraph of five sentences, efficiently conveying purpose, syntax, and follow-up. It is front-loaded with the main action and uses examples sparingly. No unnecessary repetition or fluff.

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

Completeness3/5

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

Given the complexity (4 params, no annotations, no output schema), the description covers core aspects but lacks explicit prerequisites (e.g., open project) and error handling. The mention of build_project helps, but overall completeness is adequate with gaps in setup and result expectations.

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?

The schema has 0% description coverage, so the description must compensate. It adds meaning for st_source (raw ST syntax) and declare (comma-separated name:TYPE list with examples), but task and section are only implied as identifiers for the section location. This partial coverage is adequate but not thorough.

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 writes a program section in IEC 61131-3 Structured Text, distinguishing it from XML-based tools. It specifies the action (write/create/replace) and the resource (program section), making the purpose unambiguous.

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 context for when to use the tool (plain ST, no XML required) and mentions a necessary follow-up (run build_project). However, it does not explicitly differentiate from sibling tools like create_section or export_xml, though the ST focus implies alternatives.

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/apexsotjo-blip/control-expert-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server