Skip to main content
Glama

Safe-haven analysis

analyze_safe_haven
Read-onlyIdempotent

Rank currencies by a 0–100 safe-haven score that combines low volatility, shallow drawdown, and 2008-crisis resilience. Use for "which currency holds up in a crisis" questions. Provide currencies to score specific codes, or omit to rank the liquid-fiat pool. Precious metals are not supported. Use analyze_volatility for pure dispersion and analyze_drawdown for peak-to-trough loss. Defaults: window from 2007-01-01 (or 20 years before to), base USD, limit 10. Returns { base, from, to, crisis, results[] }. Returns an error when no rate data is available for the window. Requires a signed-in connection and the Growth plan or higher; each successful call bills 1 API request.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "analyze_safe_haven"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoWindow end YYYY-MM-DD (UTC). Defaults to today.
baseNoBase currency to measure against (3-letter ISO 4217). Defaults to USD.
fromNoWindow start YYYY-MM-DD (UTC). Defaults to 2007-01-01 (spans the 2008 crisis + COVID), or to 20 years before `to` when that is later.
limitNoHow many to return (default 10, max 50).
currenciesNoComma-separated currencies to score, e.g. CHF,JPY. OMIT to rank the liquid-fiat safe-haven pool (precious metals are not supported).

Output Schema

NameRequiredDescriptionDefault
toYes
baseYes
fromYes
crisisYes
resultsYes
universeNo

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"
      +    },
      +    "crisis": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "from": {
      +          "type": "string"
      +        },
      +        "label": {
      +          "type": "string"
      +        },
      +        "to": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "label",
      +        "from",
      +        "to"
      +      ],
      +      "type": "object"
      +    },
      +    "from": {
      +      "type": "string"
      +    },
      +    "results": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "crisisReturnPct": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "currency": {
      +            "type": "string"
      +          },
      +          "maxDrawdownPct": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "note": {
      +            "type": "string"
      +          },
      +          "score": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "volatility": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          }
      +        },
      +        "required": [
      +          "currency",
      +          "score",
      +          "volatility",
      +          "maxDrawdownPct",
      +          "crisisReturnPct"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "to": {
      +      "type": "string"
      +    },
      +    "universe": {
      +      "enum": [
      +        "liquid",
      +        "majors"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "base",
      +    "from",
      +    "to",
      +    "crisis",
      +    "results"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds substantive context beyond them: the failure mode ('Returns an error when no rate data is available for the window'), the auth prerequisite ('signed-in connection'), the plan gate ('Growth plan or higher'), and cost ('bills 1 API request'). These are exactly the operational facts an agent needs before calling.

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 purpose and score definition, then usage routing, then operational facts — a sensible order with no filler sentences. It loses a point for restating defaults that the schema already declares verbatim, which is the one block that does not earn its space.

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 five-parameter, zero-required analytical tool, the definition covers scoring methodology, pool defaults, sibling routing, error behavior, auth, plan tier, and billing. An output schema exists, yet the description still sketches the return shape, so 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 description coverage is 100%, so all five parameters are already documented in structured form; the description's restatement of defaults (from 2007-01-01, base USD, limit 10) and the omit-vs-provide behavior for `currencies` largely duplicate the schema. It adds only the framing of the no-currencies case as 'the liquid-fiat pool', so baseline 3 is appropriate.

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 and resource ('Rank currencies by a 0–100 safe-haven score') and defines exactly what the score is composed of (low volatility, shallow drawdown, 2008-crisis resilience). This lets an agent distinguish it from analyze_volatility and analyze_drawdown 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?

Gives an explicit use case in user-question form ('which currency holds up in a crisis'), names two alternative tools with the condition that selects each ('pure dispersion', 'peak-to-trough loss'), and states an exclusion ('Precious metals are not supported'). When-to-use, when-not, and alternatives are all present.

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