Skip to main content
Glama
gx3-mcp-server

gx3-mcp-server

gx3_ladder_export_svg

Export GX Works3 ladder diagrams as SVG files or text for viewing and documentation, with optional device and position-range filters.

Instructions

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'.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "program": "<program>",
      "root": "<root>"
    },
    "name": "gx3_ladder_export_svg"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootYesExtracted project folder. For a .gx3 archive, keep it inside GX3_MCP_OUTPUT_DIR so its extraction cache stays inside the output boundary.
deviceNoOnly rungs referencing this device in any role.
outputNoOptional SVG file (-o). Relative to GX3_MCP_OUTPUT_DIR; absolute paths must stay inside it. Parent dirs are created.
programYesProgram/POU name or LDDB file name, e.g. 001_LDDB.db.
pos_rangeNoOnly rows whose internal pos is within A-B (inclusive); not necessarily GX Works3 step numbers.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it explains that passing 'output' writes a file under GX3_MCP_OUTPUT_DIR, that omission returns SVG text, and that large output spills to a file. It also notes the path boundary rule for 'output'. It omits failure modes and any confirmation that this is a non-mutating export, which keeps 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?

Purpose is front-loaded, followed by trigger phrasing, then alternatives, then output behavior. Mostly dense and useful, but the CLI-equivalence line and the 'same renderer as ladder-layout --format svg' note are implementation detail that an agent selecting the tool rarely needs.

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?

There is no output schema, so the description must explain the return value, and it does: SVG text by default, a file when 'output' is supplied, with spill-to-file for large results. Combined with the sibling routing and path-boundary guidance, an agent has everything needed to call it correctly.

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 100%, so the schema already documents all five parameters including pos_range semantics and the output path constraint. The description adds only marginal meaning, restating that 'device' and 'pos_range' filter results and that 'output' controls file-vs-text behavior. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ('Export a GX Works3 ladder diagram as an SVG image') and immediately scopes it to viewing or documents. It also explicitly separates this tool from gx3_ladder_print (TXT) and gx3_run_command with ladder-layout (coordinate JSON), so an agent can pick the right tool without opening any schema.

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

Usage Guidelines5/5

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

Gives direct trigger phrasing ('when asked to draw a ladder, export SVG, or save a ladder image') and names the alternatives with the exact conditions that select them: gx3_ladder_print for TXT diagrams, gx3_run_command ladder-layout for coordinate JSON. Both when-to-use and when-not-to-use are covered.

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