Skip to main content
Glama

Correlation analysis

analyze_correlation
Read-onlyIdempotent

Return the Pearson correlation of each currency's daily returns with base over a window (−1..1), plus the number of overlapping observations. Use for diversification or co-movement questions such as "does CHF track EUR?". currencies is required and comma-separated; a non-USD base is usually more meaningful. Use analyze_volatility for dispersion and analyze_history for raw change. Defaults: 365-day window ending today. Returns { base, from, to, results[] }; correlation is null when it is undefined for the window. Requires a signed-in connection and the Growth plan or higher; each successful call bills 1 API request.

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": {
      "currencies": "<currencies>"
    },
    "name": "analyze_correlation"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoWindow end YYYY-MM-DD (UTC). Defaults to today.
baseNoReference currency to correlate against (3-letter ISO 4217). Defaults to USD (a non-USD base is more meaningful).
fromNoWindow start YYYY-MM-DD (UTC). Defaults to 365 days before `to`.
currenciesYesComma-separated currencies to correlate with `base`, e.g. GBP,CHF,SEK.

Output Schema

NameRequiredDescriptionDefault
toYes
baseYes
fromYes
resultsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "base": {
      +      "type": "string"
      +    },
      +    "from": {
      +      "type": "string"
      +    },
      +    "results": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "correlation": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "currency": {
      +            "type": "string"
      +          },
      +          "note": {
      +            "type": "string"
      +          },
      +          "observations": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "currency",
      +          "correlation",
      +          "observations"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "to": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "base",
      +    "from",
      +    "to",
      +    "results"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, so the safety profile is covered; the description adds genuinely new operational context: signed-in connection required, Growth plan or higher, 1 billed API request per successful call, and a 365-day default window. The one gap is that it does not say how overlapping observations are counted or how sparse data is handled beyond null correlations.

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 behavior and return range, then usage case, alternatives, defaults, and billing – a sensible priority order. Slightly dense as one paragraph and repeats a few schema details (default window, non-USD base note), but little is wasted.

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?

An output schema exists, yet the description still gives the return shape `{ base, from, to, results[] }` and the meaningful null case; it also covers auth, plan tier, and billing cost. For a read-only analysis tool with four parameters, 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.

Parameters3/5

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

Schema coverage is 100% and the schema already documents the currency format, ISO 4217 base, ISO date window, and all defaults. The description mostly restates schema content (comma-separated currencies, required, non-USD base more meaningful) rather than adding new semantics, so the baseline 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?

States a specific verb (return) and resource (Pearson correlation of each currency's daily returns with `base`), plus the output range (−1..1) and the overlap count. It is clearly distinguishable from siblings, and the description names the two nearest ones (analyze_volatility for dispersion, analyze_history for raw change).

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?

Gives an explicit use case ("diversification or co-movement questions such as 'does CHF track EUR'") and explicitly routes away from this tool to analyze_volatility and analyze_history for those adjacent needs. Required-parameter expectation is also stated.

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.

Resources