Skip to main content
Glama

Market Indicators

Compute indicators

compute_indicators
Read-onlyIdempotent

Calculates indicators from prices the user gives. Use it when the user gives their own prices and wants indicators calculated, such as "calculate ATR and stochastic from these candles". Pass prices (2 to 250 candles, oldest first, each with a numeric close and optionally time, open, high, low and volume) and indicators from sma, ema, rsi, macd, bollinger, atr, stochastic and vwap; optionally periods and series_length. atr and stochastic need high and low on every candle, and vwap needs high, low and volume. Returns the latest value and a short series for each indicator, with the settings used. Makes no outside request and keeps nothing. Informational only, not financial advice; gives no signals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pricesYesCandles, oldest first, at most 250
periodsNoLookback length per indicator, in candles; any left out use the default shown
indicatorsYesIndicators to calculate: sma, ema, rsi, macd (12, 26, 9), bollinger (2 standard deviations), atr, stochastic (%K and %D) and vwap (cumulative over the given candles)
series_lengthNoHow many of the most recent values to return for each indicator, 5 by default

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
asOfYesDate or time of the last price used
errorNoPresent when status is not ok: a stable code, what went wrong and what to do next.
noticeYes
sourceYesWhere the prices came from
statusYes
candlesYesNumber of candles the indicators were calculated over
libraryYesThe library that did the calculation
skippedYesRequested indicators that could not be calculated, with the reason
indicatorsYes
latestCloseYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, closed-world, so the bar is lower; the description still adds real context: 'Makes no outside request and keeps nothing' (reinforcing statelessness), the per-indicator data prerequisites (atr/stochastic need high+low, vwap needs high+low+volume), and the informational/no-signals disclaimer. It does not describe behavior when periods exceed the candle count, which would have earned a 5.

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?

Purpose is front-loaded, then usage, then data requirements, then return shape and disclaimer, with zero filler sentences. It is dense and somewhat run-on for a single paragraph, but every clause carries information.

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 tool with nested objects and 4 parameters, the description covers inputs, per-indicator prerequisites, defaults, return shape and a legal disclaimer, and an output schema exists so return values need not be spelled out. The only omission is error/degraded behavior when a lookback period exceeds the supplied candles.

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 the schema already documents ranges, defaults and per-indicator data requirements. The description restates these (2-250 candles, oldest first, optional periods/series_length) without adding syntax or semantics beyond the schema, 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+resource (calculates indicators) and immediately scopes it with 'from prices the user gives,' which is exactly what separates it from the sibling get_indicators that presumably supplies its own data. An agent can route between the two 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 Guidelines4/5

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

Explicit when-to-use condition ('when the user gives their own prices and wants indicators calculated') reinforced with a concrete user-phrasing example. It implies but never names the alternative case (user has no prices / wants fetched data), so it stops short of the 5-level explicit exclusion.

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