Skip to main content
Glama

Formula over metrics

run_formula
Read-onlyIdempotent

Combine up to eight metrics in a formula and read the result as a series, as CryptoKeyhole's Formulae workbench does: + - * / ^ and functions such as sma, ema, zscore, pct_change, change, corr, rsi, drawdown, realized_vol, rebase, cumsum and ifthen. Name each input with a letter: inputs {"a": "ckh.MVRVPriced", "b": "ckh.SpotPrice"} and expression "zscore(a, 365)". Without an API key the inputs are metrics whose plan is free, at 24h, 1w or 1M.

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": {
      "expression": "<expression>",
      "inputs": "<inputs>"
    },
    "name": "run_formula"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoExclusive UNIX seconds UTC. Leave it out to read up to the latest observation.
startNoInclusive UNIX seconds UTC. Without it fetch_metric reads the latest year of daily observations (ten years of weekly ones, every monthly and yearly one).
inputsYesOne to eight inputs: a letter to a metric id, for example {"a": "ckh.SpotPrice"}.
intervalNoResolution: 24h daily, 1w weekly, 1M monthly. get_metric_metadata gives the intervals a metric offers.24h
expressionYesThe formula over the inputs' letters, for example "a / b" or "sma(a, 30)".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world and non-destructive, so the safety profile is covered. The description adds real behavioral context beyond them: the hard cap of eight inputs, the available operator/function vocabulary, and a meaningful auth-dependent restriction on which metrics can be used and at which intervals. It does not describe the shape or length of the returned series, which is the main remaining gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded and the sentences are dense with usable facts, but it is a single run-on paragraph that mixes purpose, grammar reference, examples and plan limits without structure. The 'as CryptoKeyhole's Formulae workbench does' clause is marketing framing that does not help an agent call the tool.

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?

For a five-parameter computed-series tool with no output schema, the description covers the essential unknowns: expression grammar, input lettering, the eight-input limit, interval default, and plan-gated availability. Only the returned series shape and pagination/truncation behavior are left unclear, which is a modest gap given the otherwise thorough coverage.

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%, so the schema already carries start/end/interval/expression/inputs documentation; the baseline is 3. The description does add value the schema cannot — the expression language (operators plus sma, ema, zscore, rsi, drawdown, etc.) and a worked inputs/expression pairing — but this is documented inline rather than clearly separated from the purpose statement.

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 — combine up to eight metrics in a formula and read the result as a series — which is a capability none of the siblings (fetch_metric, correlate_metrics, find_extremes) offer. An agent can tell from the first clause that this is the computed/derived-series tool.

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

Usage Guidelines3/5

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

Usage is only implied: the example shows the intended pattern (name inputs with letters, express a formula) but the description never says when to pick this over fetch_metric or correlate_metrics. The one explicit constraint — 'without an API key the inputs are metrics whose plan is free, at 24h, 1w or 1M' — is a plan limitation rather than routing guidance.

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