Skip to main content
Glama
gx3-mcp-server

gx3-mcp-server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server analyzes a GX Works3 PLC project. When you report anything from it to a user, follow these two rules without exception.

  1. NEVER name a device without its device comment.

    Write the device and its comment together every time the device appears in your answer, including in lists, tables, and restatements of a condition:

    M100 (Synthetic origin-return request)
    X16 (Synthetic emergency stop input)

    A bare M100 is not an acceptable answer to a human. The number alone is meaningless to the engineer reading it, and forcing them to look each one up defeats the purpose of this tool. Device comments come back from gx3_xref_where_used, gx3_trace_device, and query-device; if a device genuinely has no comment, write M100 (no comment) so the absence is explicit rather than ambiguous.

  2. Explain ladder logic with a ladder diagram, never with JSON.

    For an SVG image or file export, use gx3_ladder_export_svg (CLI: gx3-cli ladder-export-svg PROGRAM --root PROJECT -o ladder.svg). It uses the existing ladder renderer. With output, files are confined to GX3_MCP_OUTPUT_DIR, just like other MCP artifacts. Without it, SVG is returned as text, with the usual large-output spill to a file.

    For a plain-text explanation of how a rung is wired, show the actual ladder text from gx3_ladder_print, or from ladder-diagram with --format text (its default) or --format markdown. Quote it verbatim inside a code block so the contacts and coils stay aligned.

    Do NOT paste --format json output, dictionaries, or any structured dump as the explanation of a circuit. JSON is for you to parse, not for a person to read. A PLC engineer reads ladder; showing them the JSON that describes the ladder is strictly worse than showing them the ladder.

    Use gx3_ladder_print with section, pos_range, or device to narrow the output to the circuit under discussion rather than dumping a whole program.

These rules apply to what you show the user. You may of course request and parse JSON internally.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
gx3_list_commandsA

List every project-read-only GX3 CLI command this server will run, with a one-line summary of each. Read-only; touches no project. Call this before gx3_run_command when no typed tool fits, to see what is actually available rather than guessing a command name.

gx3_trace_deviceA

Trace a device's ON/OFF/hold conditions from exact ladder topology. MC master-control zone conditions are folded into the enable logic, and the output warns on multi-OUT-coil devices and rows below a conditional jump. The output carries each device's comment: keep every device paired with its comment when you report the result, and show the rung itself with gx3_ladder_print rather than describing it in prose.

gx3_interlock_checkA

Static satisfiability check: can two coils' ON/enable conditions be true at the same time? A 'mutually-exclusive' verdict is sound; a 'simultaneous-possible' verdict returns a witness assignment but is not a reachability proof.

gx3_xref_where_usedA

Writers and readers of a device with POU name and real step. The first line carries the device comment; repeat it alongside the device in your answer instead of reporting a bare device number. Requires the xref DB: run gx3-cli xref build --root <root> once per project first.

gx3_data_flowA

Build conservative argument-level source-to-destination value-flow edges. Known transfer and other classified instructions produce edges with argument indexes, ranges, widths, execution condition, and confidence. Unknown or partially parsed operations are returned as unresolved records; no guessed edge is emitted. Device comments are included when available.

gx3_lintA

Run static review checks over the whole project and return a per-check summary with finding counts by severity. Checks: duplicate coils, multi-writers, alarm quality, unused devices, contradictory comments, linked-device writes, and signed/width/division type problems. Reads the project; WRITES one CSV per check plus a JSON summary into the working directory. Findings are advisory: a duplicate coil may be a deliberate SET/RST pair, so report the severity and let the engineer judge. Needs the index and xref DBs for the full check set.

gx3_dead_logicA

Find logic that can never do anything: contacts that can never close, NC contacts on always-ON relays, coils and words written but never read, and SET latches with no matching RST. Returns findings grouped by kind with the device, its comment and where it appears. Reads the project; WRITES a CSV under the output directory. Devices refreshed from a network are excluded, since a remote station may be the real reader. Requires the xref DB.

gx3_device_mapA

Report, per device type, observed LD usage, density, and gaps in the index. Gaps are not verified free allocations: ST/FBD, unresolved accesses and external or reserved allocations are not excluded. Verify them in GX Works3 before adding devices. Read-only; returns a table and writes nothing. Requires the index-lite DB: run gx3-cli index-lite build --root <root> once per project first.

gx3_alarm_mapA

Inventory every alarm and fault device with what triggers it, whether it latches, any timer setpoint, and what resets it. Answers "what raises this alarm and how is it cleared" without reading the ladder by hand. Reads the project; WRITES a CSV. Interpret clearing from the hold type: a plain OUT clears when its enable logic goes false; SET-latched alarms require a reset path, and self-hold circuits require their seal-in path to drop or reset logic to act. Do not infer a power-cycle requirement merely from an empty RST list. Requires the xref DB.

gx3_semantic_diffA

Compare two versions of a project rung by rung and return what was added, removed or changed. Rungs are matched by their stable block GUID rather than by position, so inserting a rung does not report everything after it as changed. Use it to review what a revision actually did. Reads both projects; WRITES a detail CSV. Neither project is modified.

gx3_network_mapA

Map how this PLC is wired to everything outside it: IP addresses, CC-Link and SCON stations, and safety relationships, aggregated into one view. Use it to find which unit or remote station owns a device before assuming the program drives it. Reads the project and the comm detail CSVs; WRITES its own CSVs under the output directory. It does not communicate with any device -- everything is read from the project files.

gx3_ladder_export_svgA

Export a GX Works3 ladder diagram as an SVG image for viewing or documents. Use this when asked to draw a ladder, export SVG, or save a ladder image. Equivalent CLI: gx3-cli ladder-export-svg PROGRAM --root PROJECT -o ladder.svg. Uses the same renderer as ladder-layout --format svg. Pass 'output' to save under GX3_MCP_OUTPUT_DIR; otherwise returns SVG text (large output spills to a file). Filter with 'device' or 'pos_range'. For TXT diagrams use gx3_ladder_print; for coordinate JSON use gx3_run_command with command='ladder-layout'.

gx3_ladder_printA

Render a program in GX Works3 print-text layout. This is the output to show a user when explaining how a circuit is wired: quote it verbatim in a code block, never a JSON dump of the same rung. Output can be large; pass 'output' to write it to a file. To emit only the circuit under discussion, use 'list_sections' to discover section titles, then filter with 'section', 'pos_range' (A-B), or 'device'. For an SVG image export, use gx3_ladder_export_svg.

gx3_explain_snapshotA

Match a captured device snapshot against the enable conditions the static trace produced, and say what the snapshot does not answer for. Reads files only: this never opens a PLC connection, and there is no MCP tool that does. Report the analysis state with the result -- a device the snapshot holds no value for comes back as 'no measured value; file only', and the rows that did evaluate are not the whole answer when that appears. One snapshot explains the instant it was captured, never the cause of a past stop or trip: do not use it to answer 'why did this trip earlier'.

gx3_replay_captureA

Read an already-captured CSV/JSON device log offline: normalize it, emit per-device time series, list value change points, or export one instant as a snapshot for gx3_explain_snapshot. Reads files only and never opens a PLC connection. An imported or polled log is not a scan-synchronized recording: two devices that appear to change together may simply have been sampled together, so do not read ordering between devices out of it.

gx3_run_commandA

Escape hatch: run any MCP-allowed, project-read-only GX3 CLI command with explicit arguments. Project-mutating commands and local demo generation commands are rejected. Local artifacts are confined to GX3_MCP_OUTPUT_DIR. Prefer the typed tools above when one fits; for SVG ladder images use gx3_ladder_export_svg. Both ladder-export-svg and the existing ladder-layout (JSON by default, or --format svg) remain available here.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.1/5.0

Scored across 16 tools

Disambiguation4/5

Each tool targets a distinct analysis question (trace, interlock, xref, data flow, lint, dead logic, alarm, network, snapshot) and the descriptions explicitly disambiguate near-neighbors like ladder_print vs ladder_export_svg vs run_command. The main ambiguity is gx3_run_command, an escape hatch that can reproduce many of the typed tools' outputs, though guidance says to prefer typed tools.

Naming Consistency4/5

All 16 tools share a consistent gx3_ prefix and snake_case format, which is highly readable. However the internal pattern varies—verb-first (trace_device, explain_snapshot), noun-first phrases (device_map, alarm_map, data_flow), and noun_verb (ladder_export_svg)—so it is not a strict verb_noun convention.

Tool Count4/5

16 tools for a rich PLC static-analysis domain is slightly on the heavy side but each is well-scoped and earns its place through a distinct analysis capability. No redundant or trivial entries.

Completeness4/5

The read-only analysis surface is broadly complete: viewing, tracing, cross-reference, lint, dead logic, alarm/device maps, diff, network, and snapshot/capture workflows are all covered. Minor gap: prerequisite DB builds (xref build, index-lite build) are explicitly outside the MCP surface, so agents must run them externally before several tools work.

Maintenance

ActivityActive
ResponsivenessNo recent community issues