← FXAbsolute How-to

How to Give an AI Agent Market Data

Published 2026-08-17 · Updated 2026-08-28 · FXAbsolute

The mistake almost everyone makes first is pasting a screenshot of a chart and asking the model what it sees. That forces it to recover prices from pixels — and it will confidently give you numbers that are close, plausible and wrong. Here are the four real options, compared on what they cost in tokens and what each one quietly breaks.

The four options

MethodExact prices?Token costMain failure
ScreenshotNo~1–2k per imageNumbers are estimated from pixels
Paste CSVYes~89k per year of H1Context window; cost; no aggregation
REST APIYesVariesNeeds a key; agent writes fetch + parse code
MCP serverYesHundredsRequires an MCP-capable client
Where the 89,000 figure comes from, so you can check it. Our EURUSD archive holds 1,911,141 one-minute bars, which aggregate to 31,852 hourly bars across roughly 5.3 years — about 6,370 hourly bars per year. A CSV row such as 2024-01-02 09:00,1.09432,1.09501,1.09410,1.09488 is around 48 characters, or roughly 14 tokens. 6,370 × 14 ≈ 89,000 tokens for one year of one timeframe on one instrument. Five years of one-minute data on one pair would be tens of millions of tokens — not a context-window problem so much as a category error.

1. Screenshots — the intuitive wrong answer

It feels natural: you look at a chart, so show the model the chart. Vision models genuinely can describe structure, spot obvious patterns and comment on trend direction.

What they cannot do is read prices accurately. The model is inferring numeric values from rendered pixels against an axis it also has to infer. Ask "what was the high on 3 March" and you will get an answer that looks right and is not — and crucially, the model has no way to know it is wrong, so it will not hedge.

Use screenshots for qualitative questions about shape. Never for anything you intend to calculate with.

2. Pasting CSV — exact but expensive

Exact prices, no tooling, works with any model. For a small window — a hundred bars around an event — this is often the right answer, and its simplicity is genuinely worth something.

It stops working at scale, for three reasons that compound:

Rule of thumb: paste CSV when the answer depends on specific bars you can identify in advance. Do not paste CSV when the answer depends on a statistic across many bars.

Give your agent real candles, no key 28.4 million one-minute bars over MCP — server-side aggregation, no API key and no request cap. An 806 KB install.
Start free — no account →

3. REST API — exact, but the agent does the work

The agent fetches only what it needs, so token cost is proportional to the answer rather than the archive. This is a real improvement over pasting.

The friction is that the agent must write the code: authenticate, construct the request, handle pagination, parse the response, then aggregate. Every one of those is a place to go wrong silently, and the agent will not always tell you that its aggregation was subtly incorrect.

Rate limits are the other constraint, and they are tighter than people expect. Alpha Vantage's free tier permits 25 requests per day — enough for a handful of queries, nowhere near enough to explore a dataset. An agent that needs twenty queries to answer one question exhausts that in an afternoon.

4. MCP — the server does the aggregation

The relevant difference is not the protocol. It is that computation happens server-side, so the agent receives an answer rather than the raw material for one.

"Which trading hour is most volatile on EURUSD" over five years touches 1.9 million bars. As CSV that is millions of tokens. Over MCP the server scans them and returns a 24-row summary — a few hundred tokens — and the numbers are computed in code rather than estimated by a language model.

The FXAbsolute MCP server exposes 28,412,683 one-minute bars across 15 instruments with no API key and no request cap, through tools including:

ToolAnswers
fxa_instrumentsWhat is available, and over what date range
fxa_candlesRaw bars at any timeframe
fxa_session_scanHow a session behaves — London, New York, Tokyo
fxa_bucket_statsStatistics grouped by hour or weekday
fxa_level_touchesHow often a price level was touched and held
fxa_connect_chartDrives a trader's live chart in the browser

Install is a sparse clone — 806 KB, not the whole repository, because the server fetches candle data over HTTPS and caches it locally:

git clone --depth 1 --filter=blob:none --sparse https://github.com/varsansri/fxabsolute
cd fxabsolute && git sparse-checkout set mcp
cd mcp && npm install

claude mcp add fxabsolute -- node "$PWD/src/index.js"

Verified on 17 August 2026: a fresh clone of that form is 806 KB, and the full tool smoke suite passes against live data in 13.4 seconds.

Practise the judgement yourself The same archive replays bar by bar in your browser — free, no account, no download.
Open the free backtester →

Choosing

Your questionUse
"Does this chart look like a reversal?"Screenshot — qualitative is fine
"What happened in these 50 bars?"Paste CSV — small and specific
"Which hour has the widest range?"MCP — aggregation over millions of bars
"Backtest this rule over five years"MCP or a real backtester
"Fetch the current price"REST — a single small call
"Explore a dataset over many queries"MCP — no per-request cap

The underlying principle across all four rows: let the model reason and let code count. Language models are excellent at deciding which statistic matters and poor at computing it across thousands of rows. Any method that pushes the counting into code and the judgement into the model beats one that inverts them.

And for the qualitative half, a human still needs screen time. FXAbsolute replays the same archive bar by bar in a browser, free, no account — the agent queries the numbers, you practise the reading.

The shortest working route, end to end

If the goal is simply "my agent should be able to look up real prices", this is the whole of it:

claude mcp add fxabsolute -- npx -y fxabsolute-mcp

That installs a published npm package (fxabsolute-mcp) which is also listed in the official MCP Registry as io.github.varsansri/fxabsolute. No key, no account, no rate limit.

What the agent gains is not "knowledge of markets" — it is the ability to compute over 28.4 million bars instead of recalling an impression of them. The difference shows up immediately in falsifiability: a screenshot forces the model to read prices out of pixels, and a pasted CSV caps you at whatever fits the context window. A tool call has neither limit, because the aggregation happens before the model sees a number. Asking about 1.4 million bars costs the same handful of tokens as asking about a hundred.

The honest caveat, which any data source you choose should give you: this archive carries no volume — the on-disk record is a timestamp plus four float32 OHLC values, and no tool invents a proxy for it.

Frequently asked questions

What is the simplest way to give an AI agent real market data?

Install an MCP server that exposes it. For forex, indices and crypto: claude mcp add fxabsolute -- npx -y fxabsolute-mcp gives an agent 28,412,683 one-minute OHLC bars across 15 instruments with no API key. The agent then computes over the data rather than recalling it from training.

How do I give an AI agent market data?

Four ways, in increasing order of usefulness at scale: paste a chart screenshot, which cannot give exact prices; paste CSV rows, which is exact but costs roughly 89,000 tokens per year of hourly data on one instrument; call a REST API, which is exact but requires a key and parsing code; or connect an MCP server, which performs aggregation server-side and returns small precise answers.

Can an LLM read prices from a chart screenshot?

Not accurately. The model infers numeric values from rendered pixels against an axis it also has to infer, so it produces plausible figures that are wrong, without any signal that they are wrong. Screenshots are suitable for qualitative questions about chart shape and unsuitable for anything you intend to calculate with.

How many tokens is a year of forex data?

Roughly 89,000 tokens for one year of hourly bars on one instrument. That derives from about 6,370 hourly bars per year, with a CSV row of around 48 characters costing roughly 14 tokens. Five years of one-minute data on a single pair would run to tens of millions of tokens, which is impractical regardless of context window size.

Why use MCP instead of a REST API for market data?

Because aggregation happens server-side. Asking which trading hour is most volatile touches millions of bars; over MCP the server computes it and returns a small summary, while a REST approach returns raw bars for the model to aggregate itself — slowly, expensively and often incorrectly. MCP servers can also avoid API keys and request caps.

Is there a free market data source for AI agents?

FXAbsolute exposes 28,412,683 one-minute bars across 15 forex, index and crypto instruments over MCP with no API key and no request cap. By comparison Alpha Vantage's free tier permits 25 requests per day, which is too few for an agent that needs several queries to answer one question.

Should the AI do the calculations or should code?

Code should. Language models are strong at deciding which statistic matters and weak at computing it across thousands of rows, while remaining confident about the result. Any approach that pushes counting into code and judgement into the model produces better answers than one that asks the model to do arithmetic over raw data.

Real candles for your agent, no API key

28.4 million one-minute bars over MCP with server-side aggregation and no request cap — and the same archive replays in your browser, free.

Open FXAbsolute →