Skip to main content
Glama

generate_common_fun_ldr

Generates FATEK .ldr ladder-logic files from native FUN specs and I/O contracts, with optional acceptance checks and target-profile validation.

Instructions

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.
    

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": {
      "output_name": "<output_name>",
      "spec": "<spec>",
      "io_contract": "<io_contract>"
    },
    "name": "generate_common_fun_ldr"
  }
}

Input Schema

NameRequiredDescriptionDefault
specYesOrdered parameterized move, integer/float math, analog, bit access, logic, comparison, conversion, timer, counter, peripheral, pulse or PID specification; one network per function.
acceptanceNoOptional executable scan cases checked before and after encoding.
io_contractYesComplete user-authorized physical X inputs and Y outputs.
output_nameYesNew plain .ldr filename in the artifact directory; never overwrites.
strict_writersNoWhen true, reject conflicting or unsafe multiple device writers.
target_profileNoSampled CPU/header profile; required for physical peripheral, pulse, IMDIO and TPCTL entries, otherwise optional with FBs-20MC default.
require_acceptanceNoWhen true, reject generation unless acceptance cases are supplied.

Output Schema

NameRequiredDescriptionDefault
errorNoValidation error code, message and written=false.
artifactNoArtifact metadata on success; absent when validation fails before writing.
warningsNoGeneration or verification warnings; empty when none were reported.
diagnosisNoLDR failure diagnosis, when available.
response_modeYesCompact or full response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.3.0
    • changedOutput schema / $defs / ArtifactDescriptor / properties / uri / description
      Previous value: -"MCP resource URI for the artifact bytes."New value: +"Artifact MCP resource URI."
    • changedOutput schema / properties / diagnosis / description
      Previous value: -"Structured LDR generation failure diagnosis; absent on success."New value: +"LDR failure diagnosis, when available."
    • changedOutput schema / properties / error / description
      Previous value: -"Structured error code, message and written=false on handled validation failure."New value: +"Validation error code, message and written=false."
    • changedOutput schema / properties / response_mode / description
      Previous value: -"Whether repeated design metadata was compacted or returned in full."New value: +"Compact or full response."
  2. Addedv1.2.1

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare the safety profile (readOnlyHint=false, destructiveHint=false, openWorldHint=false), so the description only needs to add prerequisite/behavioral context. It does contribute two real facts: LCNV requires an initialized table, and there is no offline model, which tells the agent the call can fail for environmental reasons. It says nothing about failure modes, validation ordering, or what the acceptance checking does at runtime.

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?

Three short sentences with no filler, and the core action is front-loaded before the caveats. The parenthetical '(scaling: lcnv)' and 'series EN' are terse to the point of opacity, but nothing is redundant.

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?

For a 7-parameter generation tool with nested objects and acceptance cases, the description is thin, but it partly compensates by pointing at get_instruction_capabilities and flagging the LCNV prerequisite, and it does not need to explain returns since an output schema exists. It still omits how this differs from the other .ldr generators and how acceptance/require_acceptance interact with generation.

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 carries parameter semantics and the baseline is 3. The description adds no meaning beyond the schema for spec, io_contract, target_profile, strict_writers, acceptance, or require_acceptance; the 'scaling: lcnv' parenthetical is the only param-adjacent hint and it is unexplained.

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

Purpose3/5

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

The verb/resource pair ('Generate .ldr') is explicit and the source is named ('native FUN entries with series EN'), but the qualifiers are domain jargon an agent cannot resolve, and nothing distinguishes this from the many sibling generators (generate_ldr, generate_control_ldr, generate_sequence_ldr, generate_system_ldr). An agent knows it produces a .ldr file, but not clearly which class of content relative to those alternatives.

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

Usage Guidelines3/5

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

'Prefer native FUN (scaling: lcnv)' and 'get_instruction_capabilities gives setup/evidence' imply a workflow and route the agent to a prerequisite tool, and the LCNV caveat narrows applicability. However, there is no explicit statement of when to use this generator versus the other generate_*_ldr siblings, leaving the main selection decision to inference.

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