Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
rootYesRoot directory for the WinProLadder MCP server

Instructions

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

Prefer native FUN for matching tasks; consult get_instruction_capabilities before arithmetic chains (linear scaling: LCNV). Explain fallbacks; missing simulation alone does not justify substitution. Use control/sequence/system generators for recipes. Declare only user-specified X/Y and external clocks. Honor workspace policy: no M-to-M relay copies or hidden helpers. Use get_design_guide(detail=true) for setup and IR schema. Return artifact links and every warning. Offline only: no GUI import, PLC connection or hardware verification. No artifact rename/delete tools.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_capabilitiesA

Return server-wide support, policies and limits as metadata only.

    Includes build/version, generation and simulation scope, architecture policy, workspace,
    output directory and artifact delivery. detail=true expands instruction-specific limits.
    This never reads or modifies program content; use modify_network to edit one network.
    PLC access and artifact rename/delete are intentionally outside this offline server.
    
get_instruction_capabilitiesA

Find native FUN by task; omit family for the selection guide (linear scaling: LCNV).

    Pass family for limits/evidence. get_manual_reference covers PLC legality;
    get_capabilities covers server support. Unknown families are rejected.
    
get_manual_referenceA

Return bundled PLC-manual semantics, operand maxima and cited source pages.

    Use this to decide documented PLC legality, manual-edition differences or RTC register and
    control procedures. Use get_instruction_capabilities instead for implemented encoder and
    simulation coverage, or get_design_guide for generation workflow. This reads no project or
    PLC state and returns static reference data only.
    
inspect_rtc_snapshotA

Validate a caller-supplied FATEK RTC register snapshot offline.

    Use this after obtaining R4128..R4134 externally; optionally include packed R4135 to check
    hour/minute consistency. It checks field ranges and month/day, then returns decoded fields,
    expected_R4135 and consistency when supplied. Invalid or unknown fields return an error and
    nothing is written. This server has no PLC-access tool; use get_manual_reference for RTC
    register meanings and setting procedure.
    
get_design_guideA

Return offline workflow guidance for designing supported WinProLadder programs.

    Use this before generation to choose a control, sequence, system or custom-Ladder tool and
    to obtain acceptance-test patterns. With detail=false it returns compact control recipes,
    architecture policy and workflow; detail=true adds instruction notes, complete examples
    and the Ladder IR schema. This is not runtime capability metadata (get_capabilities),
    instruction operand evidence (get_instruction_capabilities), or manual/RTC reference data
    (get_manual_reference), and it does not validate IR or create a file.
    
generate_system_ldrA

Generate a new .ldr for two or more independent ControlSpec recipes in one SystemSpec.

    Never use this for one recipe, dependent ordered steps or caller-authored IR: use
    generate_control_ldr, generate_sequence_ldr or generate_ldr respectively. This tool
    allocates internal M/T/C, permits shared inputs, rejects explicit overlaps, checks
    acceptance and writes only a new artifact. Validation failure writes nothing. It does not
    execute existing IR or return a trace; use simulate_ladder for that.
    
generate_control_ldrA

Generate a new .ldr for exactly one supported control recipe in a ControlSpec.

    Never use this for multiple independent controls, ordered steps or caller-authored IR: use
    generate_system_ldr, generate_sequence_ldr or generate_ldr respectively. Supports latch,
    toggle, edges, delays, pulse, counter, direction interlock and star/delta. Physical I/O must
    be explicit; validation failure writes nothing. generate_component_comments creates only a
    separate comment-import .txt.
    
generate_sequence_ldrA

Generate a new .ldr for dependent ordered steps defined by a SequenceSpec.

    Never use this for one control, independent controls or caller-authored IR: use
    generate_control_ldr, generate_system_ldr or generate_ldr respectively. validate_ladder
    checks existing IR and cannot derive steps. Uses native T timers or FUN87 register state for
    pause/resume, never adds X/Y, and requires an explicit clock for pulse counting. Validation
    failure writes nothing; no GUI or PLC verification is implied.
    
generate_common_fun_ldrB

Generate .ldr from native FUN entries with series EN.

    Prefer native FUN (scaling: lcnv). get_instruction_capabilities gives setup/evidence;
    LCNV needs an initialized table and has no offline model.
    
generate_ldrA

Compile complete Ladder IR the caller already provides into a new binary .ldr file.

    Use generate_control_ldr/sequence/system for ControlSpec/SequenceSpec/SystemSpec.
    Check get_instruction_capabilities before arithmetic chains; prefer matching native FUN
    via generate_common_fun_ldr and explain fallbacks. No recipe design or resource allocation.
    generate_component_comments creates only a separate .txt. Returns hash, link and warnings;
    validation failure writes nothing; never overwrites.
    
inspect_pdwA

Inspect the structure and metadata of one existing workspace PDW project.

    Reports CPU, modules, sections, Chinese comments and known checksums. Tail records include
    file offsets, sizes, checksum status and payload SHA-256. Use get_pdw_artifact for generated
    bytes. FUNC199 stays opaque; invalid layouts return errors. No writes or PLC connection.
    
rewrite_pdw_metadataA

Copy PDW metadata while retaining populated program and memory bytes exactly.

    Title defaults to output stem. Pages: null preserves, [] removes, list replaces.
    Tables: null preserves, [] removes; creating tables is unsupported.
    Retains unrelated/unknown records. Workspace files only, never overwrites. Validates byte
    preservation, not original instruction semantics, GUI compatibility or PLC behavior.
    
generate_project_pdwA

Compile Ladder IR into a new PDW using a matching local CPU template.

    Sampled FBs-10MC/14MC/20MC/24MC/32MC/40MC/60MC/44MN layouts only. Retains opaque settings,
    replaces program annotations. Network.comment supports CR/LF; sections use source network
    indexes. Labelled subprograms support table_call/RETURN/END with relocated label slots.
    General control flow/FUNC199 remain unsupported. No overwrite, PLC or GUI guarantee.
    generate_component_comments produces a separate text import and cannot create a PDW.

    module_order=null preserves modules; [] removes. Other orders copy exact records from local
    catalogs, retaining duplicates; missing/conflicting records fail. No automatic I/O,
    parameter editing or hardware compatibility claim. See docs/pdw-format.md for format limits.
    
generate_pdwA

Create a new PDW binary by replacing one or two X-to-Y template rungs.

    Same rung count required. Only X0/X1, Y0/Y1/Y2 and NO/NC contacts supported.
    No branches, functions, comments or PLC operations. Templates are workspace-scoped.
    This generates a PDW binary; generate_component_comments produces only a separate .txt.
    Keep private templates outside Git; configure --root to their private directory.
    Return the actual binary artifact and warnings. Never overwrite.
    
get_pdw_artifactA

Return the exact bytes and download link for one previously generated PDW artifact.

    Use this after PDW generation when the client needs an embedded binary resource; use
    inspect_pdw to interpret project structure, or get_ldr_artifact for an .ldr. output_name
    must be the exact plain .pdw filename in the artifact directory. Missing, oversized or
    wrong-extension files return an error. This reads only and returns URI, size and SHA-256.
    
generate_component_commentsA

Create only a separate CP950 WinProLadder component-comment import .txt file.

    Call this only when the user explicitly requests 新增元件註解 or component comments. It
    does not inspect, analyze, generate or modify ladder logic or PDW projects; use analyze_ldr
    to explain the logic and device references in an existing .ldr.
    Rows use REF/COMMENT/DESCRIPTION, tabs, CRLF and CP950/Big5; COMMENT is at most 16
    encoded bytes. Never overwrites a file.
    
get_ldr_artifactA

Retrieve a generated .ldr as an embedded MCP binary resource and download link.

    Use the original output_name, including .ldr. Returns exact file bytes as base64
    with SHA-256; only reads the configured output directory. Useful when the client
    cannot access local server paths or cannot invoke resources/read directly.
    
inspect_ldrA

Inspect the binary container of one existing .ldr file without decoding its logic.

    Use this for framing, record offsets, raw payload bytes and stored/calculated CRC evidence.
    It reads one workspace-scoped file and returns metadata only; it never writes or connects to
    a PLC. Use read_ldr for decoded networks or analyze_ldr for device reads, writes and
    meaning.
    Invalid framing or file constraints return an error rather than partial interpretation.
    
read_ldrA

Decode one existing .ldr into display-order network records and optional Ladder IR.

    Use this for decoded logic and raw payloads; use inspect_ldr for container offsets or
    bad-CRC forensics, and analyze_ldr for device reads/writes and semantic summaries.
    Unsupported payloads remain opaque, complete Ladder IR is returned only when every network
    decodes, and
    bad CRC or unknown framing returns an error. The workspace file is never modified.
    
analyze_ldrA

Explain the behavior and device usage of one existing valid .ldr file.

    Use this for per-network meaning, decoded counts, device read/write references, timer
    settings and completeness warnings. Use read_ldr when full decoded logic or raw payloads
    are needed, or inspect_ldr for framing and CRC evidence. Bad CRC or unknown framing returns
    an error; opaque networks produce an explicit incomplete-analysis warning. Nothing is
    written or sent to a PLC.
    
compare_ldrA

Compare two existing .ldr files and report their structural and CRC differences.

    This only aligns decoded display-order networks as insert/delete/replace. It does not
    validate IR, simulate behavior or write a file: use validate_ladder, simulate_ladder or
    generate_ldr for those actions. Use read_ldr for either file's decoded network contents.
    
validate_ladderA

Validate one caller-supplied Ladder IR object without reading or writing .ldr files.

    Returns simplified connected IR, layout and resource/policy errors; it is not PLC syntax
    validation. To report differences between two existing .ldr files, use compare_ldr instead.
    
simulate_ladderA

Simulate caller-supplied Ladder IR and return a bounded per-scan behavior trace.

    This neither generates a system .ldr nor compares existing files; use generate_system_ldr
    for multi-control generation and compare_ldr for file differences. This is a
    Boolean/direct R/D model, not PLC emulation. scan_ms is required for T/C and FUN87/88/89.
    Supports the explicitly listed
    numeric/native subset; unsupported actions fail without a partial trace.
    Words use unsigned 16-bit storage. Missing X inputs reset false each scan.
    See get_capabilities simulation_model for assumptions and supported actions.
    
export_ldrA

Re-encode one existing .ldr into a separate new .ldr artifact.

    Use this for a lossless round trip that preserves unknown payloads and the source file's CRC
    validity state; it does not change network logic. The source remains untouched and an
    existing output_name is rejected. Returns the new artifact link, size, SHA-256 and warnings.
    Use modify_network to insert, replace or delete logic, or generate_ldr for new Ladder IR.
    
modify_networkA

Edit one network in an existing .ldr and write the result to a new .ldr file.

    Use operation replace, insert or delete; index 0 is N000 and untouched raw records are
    preserved. Unlike get_capabilities, this changes program content; get_capabilities returns
    server metadata only. The source file is never overwritten.
    

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
capability_resource

TDQS

A3.8/5.0

Scored across 25 tools

Disambiguation4/5

The large generation family (generate_ldr, generate_control_ldr, generate_sequence_ldr, generate_system_ldr, generate_common_fun_ldr, generate_pdw, generate_project_pdw) risks confusion, but descriptions aggressively cross-reference each other and state exactly when to use which alternative. Read-side tools (read_ldr, inspect_ldr, analyze_ldr) are similarly well delineated by stated purpose. A few get_* metadata tools (get_capabilities, get_design_guide, get_instruction_capabilities, get_manual_reference) are distinguishable but only after careful reading.

Naming Consistency4/5

All names follow a consistent snake_case verb_noun pattern, which is predictable and readable. Minor inconsistency comes from using different verbs for the same resource (read_ldr vs inspect_ldr vs analyze_ldr), but these reflect genuinely different operations rather than arbitrary convention drift.

Tool Count3/5

At 25 tools the surface is heavy, sitting at the borderline for a single domain. Seven near-parallel generate_* variants plus four get_* reference tools make the set feel larger than strictly needed, though the underlying ladder/PDW domain is genuinely complex.

Completeness4/5

Lifecycle coverage is strong: read/inspect/analyze, validate, simulate, compare, modify one network, multiple generation paths, and artifact retrieval all exist. The notable gap is that PDW support is generate/inspect-only (no decode of PDW logic, opaque FUNC199) and artifact rename/delete is explicitly excluded, but these are documented limitations an agent can work around.

Maintenance

ActivityActive
ResponsivenessNo recent community issues