Skip to main content
Glama

add_lag_column

Compute x(t)*x(t-lag), smooth it with a centered moving average, and append it as a named column to a target sheet to build lag matrices.

Instructions

Compute the lag-m correlation product x(t)*x(t-lag) of a series, smooth it with a centered moving average, and append it as a named column to a target sheet (builds the Month + Lag1..LagK matrix step by step).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lagNoCorrelation lag. Default 1.
modeNoproduct = x(t)*x(t-lag) (default), shift = x(t-lag).
nameNoNew column name. Default "Lag<lag>".
saveNoOptional destination path to persist the result as .sta.
sheetNoSource sheet holding the series.
attachNoAttach to the already-running STATISTICA instance and edit it live (no new process, the app is not closed).
smoothNoApply the centered moving average. Default true for product, false for shift.
targetYesTarget sheet to append the column to.
windowNoCentered moving-average window. Default 12.
variableYesSource series.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.3.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the two-stage transform (product then centered moving average) and that the result is appended as a named column, which is real behavioral detail, but it says nothing about mutation side effects on the target sheet, permissions, or how attach/save change execution.

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?

A single dense sentence that front-loads the core computation before the append action. Nothing is wasted, though the parenthetical workflow note is slightly tacked on.

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 10-parameter mutation tool with no annotations and no output schema, the description covers the core behavior but omits side effects on the target sheet, the effect of attach vs a new process, and persistence via save. The rich schema compensates for parameters, but the mutation semantics remain under-described.

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 lag, mode, window, smooth and the rest. The description ties the parameters together conceptually (the product formula, the smoothing) but adds no syntax or default detail beyond what the properties already state, so the baseline of 3 applies.

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

Purpose4/5

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

The description names a specific chain of verbs (compute, smooth, append) on a specific resource (the lag-m correlation product column x(t)*x(t-lag)) and points at a target sheet. An agent knows exactly what the tool produces, though it never explicitly contrasts itself with siblings like set_formula or statistica_time_series.

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?

There is no explicit when-to-use or when-not-to-use guidance, and no alternative is named. The parenthetical '(builds the Month + Lag1..LagK matrix step by step)' only implies the workflow context in which this tool belongs, so usage is inferable but not stated.

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