Skip to main content
Glama

fxapis — MetaTrader 5

Get price history

get_price_history
Read-onlyIdempotent

Recent price bars (candles: open, high, low, close, tick volume, spread) for one symbol from this account's broker, oldest first with bar-open times in UTC, for technical analysis such as trend, support and resistance, volatility or moving averages; timeframes M1 to MN1, up to 500 bars, the last bar still forming, and tick volume counts price changes rather than traded lots. The account must be online; an account whose terminal is not yet updated — rare — answers CAPABILITY_UNAVAILABLE instead, so use get_quotes for the current price meanwhile. Example: {"account_id": "", "instrument": "XAUUSD", "timeframe": "H1", "count": 100}

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": {
      "account_id": "<account_id>",
      "timeframe": "<timeframe>"
    },
    "name": "get_price_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
countNoBars to return, counting back from the current one: 1–500, default 100. Ask for what the analysis needs.
symbolNoOr the broker's own symbol, exactly as this broker names it. Send instrument or symbol, not both.
timeframeYesBar size: M1–M30 minutes, H1 or H4 hours, D1 a day, W1 a week, MN1 a month.
account_idYesThe fxapis account id (a UUID) from list_accounts — not the MT5 login number.
instrumentNoAn instrument from list_instruments, e.g. XAUUSD; read as this account's own symbol for it.

Output Schema

NameRequiredDescriptionDefault
rowsYesOne bar per row, oldest first; the last is still forming.
symbolYes
columnsYesThe order of each row's values: time_utc, open, high, low, close, tick_volume, spread (points).
timeframeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/openWorld annotations, it discloses ordering ('oldest first'), time base ('bar-open times in UTC'), the 500-bar cap, that the last bar is still forming (a partial-data caveat that affects analysis), and that tick volume counts price changes rather than traded lots. It also names the concrete failure mode CAPABILITY_UNAVAILABLE and its cause — unusually rich behavioral disclosure.

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 resource and return fields before the caveats, and every clause carries information (units, ordering, failure mode, sibling routing). It is a single semicolon-heavy sentence, which is dense but only mildly harder to scan than a short bulleted form would be.

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?

The tool has an output schema, yet the description still names the returned fields and their ordering, and it covers preconditions, limits, partial-bar behavior, and the error path. Nothing an agent needs to call this correctly and interpret results 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 the bar range ('up to 500 bars'), the timeframe span (M1 to MN1), and a worked example with count 100 that shows how the parameters compose. It does not explain the instrument-vs-symbol exclusivity itself, which stays solely in the schema.

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: 'Recent price bars (candles: open, high, low, close, tick volume, spread) for one symbol from this account's broker'. It also implicitly differentiates from the snapshot-style sibling by calling these historical bars for technical analysis, and explicitly routes the current-price case to get_quotes.

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 ('technical analysis such as trend, support and resistance, volatility or moving averages') and names the fallback: 'use get_quotes for the current price meanwhile' when CAPABILITY_UNAVAILABLE occurs. It also states the precondition (account must be online), which is exactly the when-to-use context an agent needs.

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