Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

Cointegration Test

workflow.run_cointegration
Read-only

Engle-Granger two-step cointegration test for a pair of price series: do they share a long-run equilibrium relationship (their spread is stationary/mean-reverting)? The standard pairs-trading signal test. Returns the cointegrating regression's hedge ratio (beta) and an ADF t-statistic on the residuals, compared against 1%/5%/10% critical values. Use when user asks "are these two assets cointegrated?" or "is this a valid pairs trade?". Returns: alpha, beta (hedge ratio), t_stat, critical_values, cointegrated (booleans at each significance level).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesSecond price series, same length and dates as y
yYesFirst price series (the dependent variable in the cointegrating regression)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=false, so safety is covered. The description adds genuine behavioral context beyond that: the two-step method, that residual ADF stats are compared to 1/5/10% critical values, and the exact returned fields (alpha, beta, t_stat, critical_values, cointegrated).

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?

Three sentences, front-loaded with the method and the question it answers, then the return payload. Slightly verbose with the rhetorical parenthetical, but every clause carries information an agent would want.

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?

With no output schema, the description responsibly enumerates the returned fields and the interpretation threshold logic, and the required parameters are fully documented in the schema. An agent can call and interpret this tool without further reference.

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 coverage is 100% with only two parameters, and the schema descriptions already state the role of y (dependent variable) and x (second series, same length/dates). The description adds no format or ordering guidance beyond what the schema provides, so the baseline of 3 applies.

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?

Names a specific statistical procedure (Engle-Granger two-step cointegration test) applied to a specific resource (a pair of price series), and frames the exact question it answers (shared long-run equilibrium / stationary spread). This distinguishes it cleanly from siblings like run_forex_correlation and primitive.hedge_ratio.

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?

Gives explicit trigger phrasing: 'are these two assets cointegrated?' and 'is this a valid pairs trade?' — a clear usage context. It does not, however, name sibling alternatives or state when not to use it (e.g. vs a plain correlation tool), so it falls short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.