Skip to main content
Glama

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

Forex Correlation

workflow.run_forex_correlation
Read-only

Correlation coefficient and minimum-variance hedge ratio between two price series of matching length, computed on daily % returns (not raw price levels, which would give spuriously high correlation between two unrelated but both-trending series). hedgeRatio follows Hull's standard futures-hedging formula: cov(returns1,returns2)/var(returns2), "how many units of series 2 per unit of series 1 minimizes the combined position's variance." No live data fetch: supply the two price series directly. The live variant is workflow.run_forex_correlation_live, which has both series fetched automatically for two named pairs. Edge cases: each series needs at least 5 positive prices, and both series must be the same length with one price per matching date (a different length is an error); a series with no movement (zero return variance) is an error because correlation is undefined. Not covered: lagged correlation, rolling windows, significance tests and confidence intervals; 4 returns is the mathematical minimum, not a reliable sample. Use when user already has two price series and wants their statistical relationship. Returns: n, correlation (-1 to 1), hedgeRatio.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "rates1": "<rates1>",
      "rates2": "<rates2>"
    },
    "name": "workflow.run_forex_correlation"
  }
}

Input Schema

NameRequiredDescriptionDefault
rates1YesFirst price series, chronological order, one price per date
rates2YesSecond price series, chronological order, same length and same dates as rates1

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld=false/destructive=false, so the bar is lower, yet the description adds real behavioral context: no live data fetch, error conditions for mismatched lengths and zero return variance, minimum sample sizes, and the reliability caveat that 4 returns is a mathematical floor not a usable sample. It does not discuss precision limitations of the coefficient estimate beyond sample size, but overall this is well beyond annotation coverage.

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?

Front-loaded with the computation and the key modelling caveat, then alternatives, then edge cases. Dense and mostly earning its place, though the parenthetical explaining spurious correlation from trending levels is longer than needed and the 5-price minimum repeats the schema's minItems (adding only the 'positive' condition).

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?

No output schema exists, but the description enumerates the returns (n, correlation in -1 to 1, hedgeRatio), and it covers inputs, error conditions, and scope exclusions. For a two-parameter pure-computation tool, nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3, but the description adds genuine meaning: inputs are daily % returns computed from supplied prices (not raw levels, with a stated reason), series must be same length with one price per matching date, and each series needs at least 5 positive prices. It also defines hedgeRatio as cov(returns1,returns2)/var(returns2) and interprets it as units of series 2 per unit of series 1.

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?

States a precise verb and resource: computes correlation coefficient and minimum-variance hedge ratio between two price series of matching length. It goes further and names the sibling it is not (workflow.run_forex_correlation_live), so an agent can discriminate without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ("Use when user already has two price series and wants their statistical relationship") plus a named alternative for the live case. It also lists what is explicitly out of scope (lagged correlation, rolling windows, significance tests, confidence intervals), which prevents misuse for those purposes.

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.