Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

var

Read-only

Estimate a vector autoregression to model how multiple time series affect each other, enabling Granger-causality tests and impulse-response analysis for data-driven decisions.

Instructions

Estimate a Vector Autoregression (VAR) model. Validation: certified parity evidence. Assumptions: All system variables are jointly covariance-stationary (no unit roots / cointegration left unmodeled); Lag order p is adequate so residuals are white noise; under-fitting biases IRFs and Granger tests; Reduced-form errors are serially uncorrelated; structural IRF identification relies on the chosen ordering/recursive scheme. Pre-conditions: Multivariate (>=2 column) time-ordered DataFrame of comparable-frequency series; Sample length large relative to kp+trend parameters to estimate each equation. Failure modes: Coefficient covariance is singular or IRFs diverge because k^2p parameters exceed available observations -> Reduce lags, drop variables, or extend the sample so n is much larger than k*p; Explosive IRFs / non-decaying responses from a non-stationary (unit-root or trending) system -> Difference or detrend the series first, or use trend='ct', and confirm stationarity before fitting. Alternatives: sp.local_projections, sp.arima, sp.iv. Typical minimum N: 100.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lagsNoNumber of lags.
alphaNoSignificance level.
se_dfNoResidual-variance denominator for coefficient standard errors. ``'stata'``/``'ml'`` uses ``T`` and matches Stata ``var`` default conditional-MLE standard errors. ``'r'``/``'unbiased'`` uses ``T - k_params`` and matches the equation-by-equation ``lm()`` standard errors returned inside R ``vars::VAR()``.stata
trendNotrend parameter (str).c
detailNoPayload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip.agent
as_handleNoIf true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running.
data_pathYesAbsolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://.
result_idNoOptional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns.
variablesNoVariable names. If None, uses all numeric columns.
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
data_sample_nNoOptional uniform random subsample size (seed=0, deterministic) — useful on huge panels.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes far beyond the readOnlyHint annotation by disclosing assumptions (stationarity, white-noise residuals, adequate lag order), failure modes (singular covariance, explosive IRFs), and operational guidance (difference/detrend, reduce lags, extend sample). This gives an agent realistic expectations of when the call will fail and why.

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?

The description is long but tightly organized into labeled sections (Validation, Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N). Each section carries distinct decision-relevant information with no filler; the most important purpose statement is front-loaded.

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 complex econometric tool with 11 parameters and an output schema, the description covers assumptions, preconditions, failure modes, minimum sample size, and alternatives. An agent has enough context to decide whether to call it and to interpret common failures without additional round-trips.

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, but the description adds meaningful parameter context: lag adequacy and under-fitting bias for lags, trend='ct' for non-stationarity handling, and ordering/recursive scheme for structural IRF identification. This is useful semantic enrichment beyond the schema.

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?

Opens with 'Estimate a Vector Autoregression (VAR) model' – a specific verb and resource that immediately identifies the tool's function. It distinguishes itself from siblings like arima, bvar, and local_projections through an explicit Alternatives section and by emphasizing VAR-specific assumptions and failure modes.

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?

Names concrete alternatives (sp.local_projections, sp.arima, sp.iv) and provides rich preconditions that clarify when VAR is appropriate. It does not, however, give explicit when-not conditions mapping each alternative to a specific scenario, so it stops just 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.

Deploy Server

Other Tools