Skip to main content
Glama

generate_system_ldr

Generates a new .ldr ladder-logic file for multiple independent ControlSpec recipes in one SystemSpec, allocating internal M/T/C and validating acceptance cases before writing a new artifact.

Instructions

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.
    

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

Input Schema

NameRequiredDescriptionDefault
specYesSystem requirement plus one or more independent control recipes.
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: +"System requirement plus one or more independent control recipes."
    • 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.7/5.0
Behavior5/5

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

Annotations only declare the coarse safety profile (readOnlyHint=false, destructiveHint=false, openWorldHint=false). The description adds real behavior beyond that: automatic M/T/C allocation, shared-input allowance, rejection of explicit overlaps, acceptance checking before and after encoding, and the critical write-safety guarantee that validation failure writes nothing while a successful call never overwrites.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four tight sentences ordered by importance: what it makes, what it must not be used for with alternatives, then internal behavior, then the execution boundary. Every clause carries distinct information with no restatement of the name or annotations.

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 generator with a 7-parameter, nested-object schema and an output schema, the description covers the remaining agent-relevant unknowns: mutation and non-overwrite semantics, failure behavior, allocation side effects, and the boundary against simulation. Return-value shape is correctly left to the output schema.

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 output_name, io_contract, acceptance, strict_writers, target_profile and require_acceptance in detail. The description adds indirect context (shared inputs permitted, overlaps rejected, acceptance checked) but gives no per-parameter guidance, so this sits at the baseline for fully-documented schemas.

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 artifact ("Generate a new .ldr") plus the exact scope: two or more independent ControlSpec recipes in one SystemSpec. The minimum-two-recipe scope distinguishes it immediately from generate_control_ldr and generate_sequence_ldr 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 an explicit exclusion clause ("Never use this for one recipe, dependent ordered steps or caller-authored IR") and routes each excluded case to a named alternative. It also separates itself from simulate_ladder for execution/trace needs, leaving nothing to inference.

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