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. Use when user already has two price series and wants their statistical relationship. Returns: n, correlation (-1 to 1), hedgeRatio.

Input Schema

TableJSON 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.6/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 genuinely non-obvious behavior: computation is on daily % returns rather than raw levels, the hedgeRatio uses Hull's cov/var formula, and no live fetch occurs. It stops short of 5 only because it doesn't discuss edge cases (e.g., zero variance, minimum series length enforcement) that an agent invoking with borderline inputs would want.

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 core operation and the key no-fetch constraint, and the return values are summarized last. The parenthetical justification of % returns and the quoted formula explanation are slightly verbose, but each sentence carries information an agent would otherwise have to guess.

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 pure-computation tool with no output schema, the description supplies the algorithmic method, the input shape requirement, the alternative sibling, and an explicit 'Returns: n, correlation, hedgeRatio' summary. Nothing an agent needs to invoke it correctly is missing.

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 meaning beyond the schema by clarifying that the series are transformed to daily % returns before computing and that both must be of 'matching length' — a constraint the schema states but the description explains the reason for. It does not document the 5-item minimum beyond what the schema declares.

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+resource (correlation coefficient and minimum-variance hedge ratio between two price series) and immediately distinguishes itself from workflow.run_forex_correlation_live by naming the sibling and the condition that selects it ('No live data fetch: supply the two price series directly'). An agent can route correctly without opening a 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?

Explicitly states the use condition ('Use when user already has two price series and wants their statistical relationship') and names the alternative (run_forex_correlation_live) with its contrasting capability ('both series fetched automatically for two named pairs'). This is the when/when-not/alternatives pattern at full strength.

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.