Skip to main content
Glama

add_fit_line

Fit an ordinary least-squares trend line to your data, write fitted values to a new variable, and optionally save or attach to a live STATISTICA session.

Instructions

Fit an ordinary least-squares line of y on x (x defaults to the case number) and write the fitted values to a new variable, so the trend can be plotted next to the data (a scriptable substitute for the interactive graph fit).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoPredictor variable. Omit to use the case number 1..N.
yYesDependent variable.
nameNoName of the new fitted variable. Default "<y>_fit".
pathYes
saveNoOptional destination path to persist the result as .sta.
sheetNo
attachNoAttach to the already-running STATISTICA instance and edit it live (no new process, the app is not closed).
degreeNoPolynomial degree. Default 1 (linear).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.3.0

TDQS

A3.9/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 burden, and it does disclose the key side effect: a new fitted variable is created in the dataset. However, it says nothing about whether the source data is modified, how missing values or attached instances behave, or what permission/state requirements exist, leaving meaningful behavioral gaps for a mutating tool.

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 front-loaded sentence that names the operation, the output, and the motivation without filler. It is dense and slightly run-on, but every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema and no annotations, the description covers the core action and its primary side effect, and the schema fills in the remaining parameters. It could say more about persistence (`save`) and live-edit (`attach`) side effects, but the essentials for correct invocation are present.

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 75%, so most parameters are already documented. The description reinforces the `x` default (case number) and the fitted-variable output, but adds nothing about `degree` polynomial fitting, `save`, `sheet`, or `attach` beyond what the schema states. Baseline 3 is appropriate.

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 description states a specific verb and resource ('Fit an ordinary least-squares line of `y` on `x`') and a concrete output ('write the fitted values to a new variable'). The parenthetical 'scriptable substitute for the interactive graph fit' distinguishes it from the heavier analysis siblings such as statistica_regression and from dialog-driven fitting.

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?

It gives clear context for use ('so the trend can be plotted next to the data') and contrasts itself with the interactive graph fit, implying when the scriptable route is preferred. It does not name a sibling alternative explicitly or state when not to use it, so it stops short of full routing guidance.

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