Skip to main content
Glama

stats_cointegration

Read-onlyIdempotent

Test two time series for cointegration using the Engle-Granger method. Returns test statistic, p-value, hedge ratio, and spread for mean-reverting pair trading.

Instructions

Engle-Granger cointegration test with hedge ratio and half-life.

Use when testing if two time series are cointegrated (mean-reverting pair). Provide two price series. Returns: Engle-Granger test statistic, p-value, critical values, hedge ratio, and spread series.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
series_xYesFirst time series
series_yYesSecond time series
significanceNoSignificance level for the test0.05
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safe, non-mutating nature is clear. The description adds valuable behavioral context by specifying the return values (test statistic, p-value, critical values, hedge ratio, spread series), which is not available from schema or annotations.

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 composed of two concise sentences: the first identifies the tool, and the second provides usage guidance and output summary. Every word serves a purpose, with no redundancy or filler.

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?

Given the absence of an output schema, the description compensates by listing the expected return values. Annotations cover safety. However, it could be slightly more complete by noting input requirements (e.g., equal length series), but overall it is adequate for an agent to use the tool correctly.

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 baseline is 3. The description mentions 'Provide two price series', which aligns with the required parameters series_x and series_y, but adds no additional semantic nuance beyond what the schema already provides.

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 explicitly identifies the tool as 'Engle-Granger cointegration test with hedge ratio and half-life', which is a specific and well-known statistical test. This clearly distinguishes it from sibling tools like stats_correlation-matrix or stats_hurst-exponent, providing a precise verb-resource pair.

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 advises using the tool 'when testing if two time series are cointegrated (mean-reverting pair)', which directly addresses usage context. While it does not explicitly list alternatives, the context of sibling tools and the clear purpose make the guidance effective.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/QuantOracledev/quantoracle'

If you have feedback or need assistance with the MCP directory API, please join our Discord server