Skip to main content
Glama

rec_start

Idempotent

Start a continuous real-time recording of online PLC variables (runs in the background until rec_stop, duration_s, max_events or stop_when).

Instructions

Start a continuous real-time recording of online PLC variables (runs in the background until rec_stop, duration_s, max_events or stop_when). Select by explicit symbols (an FB or struct instance expands to all its leaves), prefix ('MAIN.fbFill', 'GVL_Sim.aCh[1]' → every leaf under it) or pattern — the same leaves rec_scan lists for it: ''/'?' wildcards, '[ ]' literal ('GVL_Sim.aCh[1].'), a leaf is recorded when it or one of its parents matches ('*bOpen' → every bOpen). mode: 'cycle' = one PLC-timestamped sample per symbol per cycle_ms (ADS notification, cycle-accurate); 'change' = PLC-timestamped sample only when the value changes (checked every cycle_ms); 'poll' = sum-read every cycle_ms from this PC. Triggers: start_when='MAIN.bStart == TRUE' with pre_trigger_ms keeps the events before the trigger (scope-style); stop_when='MAIN.fbFill.bDone == TRUE'. Events stream to a JSONL file. duration_s is PLC time from the first sample (also while waiting for start_when); post_trigger_s ends the recording that long after the start_when trigger fired (scope-style post-trigger window). Timestamps (cycle/change) are the TwinCAT runtime's own, stored exactly with the raw bytes it sent; neighbouring variables share ONE notification (a block), which is what keeps 1 ms recordings lossless — select whole FBs, structs or arrays rather than hundreds of scattered globals. Any notification that cannot be registered fails the start (allow_partial=true records the rest and lists unsubscribed_symbols). max_delay_ms > 0 lets the runtime batch samples (fewer ADS frames; each sample keeps its own timestamp). cycle mode also records a per-cycle counter as ground truth (cycle_counter='auto' = the matching task's _TaskInfo[n].CycleCount, or your own e.g. 'MAIN.nCycleCount', or null for none) and the header carries a manifest of what was recorded from (AppTimestamp, OnlineChangeCnt, tasks, TwinCAT build, symbol version). A recording is of one program: a download / online change while it runs ends it at the last sample verified against the symbol version (program_changed); nothing sampled from the new program is written. Conditions are levels: a start_when that already holds fires at once — edge_triggers=true fires only when it BECOMES true. A condition may name one element of an array recorded as a whole (GVL_Test.aCounter[1] when GVL_Test.aCounter is recorded). engine (cycle mode): 'native' = the C++ capture service (Beckhoff AdsLib on TcAdsDll: ADS callback → ring → file, no Python on the data path), 'python' = the in-process recorder, None = recorder.engine from the config (default 'auto': native when installed). The response says which engine ran and why. After stopping: rec_verify. also_scope: also run the TwinCAT Scope configuration open in XAE (scope = its name when several are open) — StartRecord now; at rec_stop StopRecord and SaveSVD into /Scope Recordings/.svdx, the CSV .scope.csv exported from that file with Beckhoff's export tool (XAE's ExportCSV only without it, flagged), XAE's ExportCSV of what Scope holds in memory beside it (.scope.xae.csv) with both row counts compared (cross_check — a saved .svdx shorter than memory, or the reverse, is a warning), a signed link file, and the Scope View log's new ERROR / FATAL lines (scope_view_log). A .svdx still being written 15 s after SaveSVD is not exported. What Scope records (channels, sample time) is set in that configuration. With recorder.also_scope = 'ask' (default) and a Scope configuration open, leaving also_scope unset asks the user (prompt, or an error that tells you to ask and call again with true/false). After a recording Scope holds its data until it is disconnected: a recording with Scope then asks to disconnect it first — scope_disconnect=true / false is the user's answer (false: this recording without Scope).

Input Schema

NameRequiredDescriptionDefault
modeNochange
nameNo
scopeNo
engineNo
prefixNo
patternNo
symbolsNo
cycle_msNo
stop_whenNo
also_scopeNo
duration_sNo
max_eventsNo
start_whenNo
max_symbolsNo
max_delay_msNo
allow_partialNo
cycle_counterNoauto
edge_triggersNo
post_trigger_sNo
pre_trigger_msNo
scope_disconnectNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.18
    • addedInput schema / properties / scope_disconnect
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Scope Disconnect"
      +}
  2. Changed8 schema fields changedv0.8.12
    • addedInput schema / properties / allow_partial
      Added value: +{
      +  "default": false,
      +  "title": "Allow Partial",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / also_scope
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Also Scope"
      +}
    • addedInput schema / properties / cycle_counter
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": "auto",
      +  "title": "Cycle Counter"
      +}
    • addedInput schema / properties / edge_triggers
      Added value: +{
      +  "default": false,
      +  "title": "Edge Triggers",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / engine
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Engine"
      +}
    • addedInput schema / properties / max_delay_ms
      Added value: +{
      +  "default": 0,
      +  "title": "Max Delay Ms",
      +  "type": "number"
      +}
    • addedInput schema / properties / post_trigger_s
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Post Trigger S"
      +}
    • addedInput schema / properties / scope
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Scope"
      +}
  3. First observedv0.6.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations, it discloses that recording runs in the background, how it stops, timestamp and notification-block behavior, partial-registration failure, program-change termination, engine selection, and Scope prompting. These are exactly the behavioral traits an agent needs before invoking a stateful recorder.

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

Conciseness3/5

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

The first sentence is front-loaded and the length is partly justified by a 21-parameter tool. However, the remainder is a dense run-on paragraph with extensive secondary details about Scope export files, row counts, and signed link files that are hard to scan and not essential to starting a recording.

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?

Given the output schema and annotations, the description still covers lifecycle, stop conditions, failure modes, engine choice, and the tricky Scope interaction. It is complete enough for an agent to invoke the tool correctly despite its complexity.

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 description coverage is 0% for 21 parameters, so the description must carry the meaning. It explains mode, selection semantics, triggers, timing, batching, partial failure, cycle_counter, engine, and Scope controls, but it omits name and max_symbols entirely, leaving two parameters undocumented.

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?

The first sentence states a specific verb and resource: start a continuous real-time recording of online PLC variables. It also distinguishes the selection semantics from rec_scan and the lifecycle from rec_stop/rec_verify, so an agent can identify the tool without opening the schema.

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

Usage Guidelines4/5

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

The description gives clear operational context: modes, triggers, background lifetime, and the rec_verify follow-up. It names rec_scan and rec_stop, but does not explicitly compare this tool with rec_capture, rec_snapshot, or scope_record, nor does it state when not to use it.

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

Deploy Server

Other Tools