Skip to main content
Glama

generate_sequence_ldr

Generates a new .ldr file for dependent ordered steps from a SequenceSpec and validates before writing, so invalid sequences are not saved.

Instructions

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.
    

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_sequence_ldr"
  }
}

Input Schema

NameRequiredDescriptionDefault
specYesOrdered step requirement, start signal, timing and output definitions.
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_profileNoOptional sampled CPU/header profile; omit to use the default profile.
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. Changed8 schema fields changedv1.1.1
    • addedInput schema / properties / acceptance / description
      Added value: +"Optional executable scan cases checked before and after encoding."
    • addedInput schema / properties / io_contract / description
      Added value: +"Complete user-authorized physical X inputs and Y outputs."
    • addedInput schema / properties / output_name / description
      Added value: +"New plain .ldr filename in the artifact directory; never overwrites."
    • addedInput schema / properties / require_acceptance / description
      Added value: +"When true, reject generation unless acceptance cases are supplied."
    • addedInput schema / properties / spec / description
      Added value: +"Ordered step requirement, start signal, timing and output definitions."
    • addedInput schema / properties / strict_writers / description
      Added value: +"When true, reject conflicting or unsafe multiple device writers."
    • addedInput schema / properties / target_profile / description
      Added value: +"Optional sampled CPU/header profile; omit to use the default profile."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "ArtifactDescriptor": {
      +      "description": "Download metadata shared by generated and retrieved artifacts.",
      +      "properties": {
      +        "mime_type": {
      +          "description": "Media type of the returned bytes.",
      +          "title": "Mime Type",
      +          "type": "string"
      +        },
      +        "name": {
      +          "description": "Plain artifact filename.",
      +          "title": "Name",
      +          "type": "string"
      +        },
      +        "sha256": {
      +          "description": "Lowercase SHA-256 digest of the exact artifact bytes.",
      +          "title": "Sha256",
      +          "type": "string"
      +        },
      +        "size": {
      +          "description": "Artifact size in bytes.",
      +          "minimum": 0,
      +          "title": "Size",
      +          "type": "integer"
      +        },
      +        "uri": {
      +          "description": "MCP resource URI for the artifact bytes.",
      +          "title": "Uri",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "uri",
      +        "name",
      +        "mime_type",
      +        "size",
      +        "sha256"
      +      ],
      +      "title": "ArtifactDescriptor",
      +      "type": "object"
      +    }
      +  },
      +  "additionalProperties": true,
      +  "description": "Structured result for artifact-writing and artifact-retrieval tools.",
      +  "properties": {
      +    "artifact": {
      +      "anyOf": [
      +        {
      +          "$ref": "#/$defs/ArtifactDescriptor"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "Artifact metadata on success; absent when validation fails before writing."
      +    },
      +    "diagnosis": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": true,
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "Structured LDR generation failure diagnosis; absent on success.",
      +      "title": "Diagnosis"
      +    },
      +    "error": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": true,
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "Structured error code, message and written=false on handled validation failure.",
      +      "title": "Error"
      +    },
      +    "response_mode": {
      +      "description": "Whether repeated design metadata was compacted or returned in full.",
      +      "enum": [
      +        "compact",
      +        "full"
      +      ],
      +      "title": "Response Mode",
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "description": "Generation or verification warnings; empty when none were reported.",
      +      "items": {},
      +      "title": "Warnings",
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "response_mode"
      +  ],
      +  "title": "ArtifactToolOutput",
      +  "type": "object"
      +}
  3. Changed1 schema field changedv1.1.0
    • addedInput schema / properties / target_profile
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "FBs-32MC-test30",
      +        "FBs-32MN-test29",
      +        "FBs-40MC-test27",
      +        "HB1-32M-test23",
      +        "FB-28MA-test22",
      +        "FBe-40MC-test21",
      +        "FBe-20MA-test19",
      +        "FBn-26MC-test17",
      +        "FBs-60MC-test16",
      +        "FBs-20MC",
      +        "FBs-24MA",
      +        "FBs-24MA-test7",
      +        "FBs-32MA-test11",
      +        "FBs-40MA-test12",
      +        "FBs-44MN-test13"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Target Profile"
      +}
  4. Addedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare only the safety profile (readOnly=false, destructive=false, openWorld=false); the description adds substantive behavior beyond that: no write on validation failure, pause/resume implemented via native T timers or FUN87 register state, no implicit X/Y allocation, explicit clock required for pulse counting, and no GUI or PLC verification implied. These are exactly the runtime traits an agent would otherwise have to discover by trial.

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?

Front-loaded purpose, then a routing sentence, then a dense behavioral block — every sentence carries information. The second paragraph is cramped (timers, IO allocation, clock, and verification concerns run together) and would read better as short clauses, but nothing is filler.

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?

For a non-read-only generation tool with an output schema (so return values need no prose), the description covers the missing pieces an agent needs: failure atomicity, hardware-implication limits, and the absence of downstream verification. Nothing material is left ambiguous.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description still adds meaning that the schema does not: the clock requirement maps to spec.clock's purpose ('explicit clock for pulse counting'), and 'never adds X/Y' constrains what io_contract authorizes versus what the generator will infer. That is genuine semantic lift, though not exhaustive across all seven parameters.

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?

Specific verb plus resource plus scope: 'Generate a new .ldr for dependent ordered steps defined by a SequenceSpec.' It immediately bounds the domain (sequence-of-steps, not single or independent controls) and names the three sibling generators that cover the excluded cases.

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?

Explicit when-not guidance with each alternative mapped to a condition: one control -> generate_control_ldr, independent controls -> generate_system_ldr, caller-authored IR -> generate_ldr. It also preempts a plausible wrong choice by stating validate_ladder checks existing IR and cannot derive steps.

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