The problem
People increasingly do their work inside an AI assistant. A product that cannot be reached from there gets copied and pasted around, or replaced by one that can. The Model Context Protocol (MCP) is the standard way to connect the two.
The quick way to build an MCP server is to wrap every API endpoint as a tool. It takes an afternoon and works badly. The model has to guess which of a dozen similar tools to call, chain several together for one question, and do arithmetic on raw JSON. Each of those is a place to go wrong, and the errors are confident ones.
Finstrm is a Bloxso.me product: an API that serves live market data from several exchanges. This is how we made it usable from Claude, ChatGPT and other assistants, and what it took to do properly.
What we built
A server with five tools in front of an API with eleven endpoints. The tools follow the questions people ask, not the shape of the API.
| Tool | The question it answers |
|---|---|
list_markets |
What pairs do you have, and on which exchanges? |
get_price |
What is this trading at? Which exchange is cheapest? |
get_candles |
How has this moved over the last hour, day, week? |
get_order_book |
How deep is the book? How wide is the spread? |
get_recent_trades |
What just traded? Is it mostly buying or selling? |
get_price is one call for the model and two for the server: it fetches every exchange
and the combined view, then returns the comparison already made. A question like “which
exchange is cheapest to buy on” needs one tool call and no arithmetic.
It runs on Cloudflare Workers, holds no state and no credentials, and needed no changes to the API underneath. Anyone can connect an assistant to it.
Decisions
Tools shaped like questions
Each tool description says when to use it and when to use a different one. “For just the
current price, use get_price instead” is in the order book tool’s description, because
that is the mistake a model would otherwise make. In the tests, both models averaged 1.1
tool calls per question.
The server does the arithmetic
Spreads in basis points, percentage change over a period, highs and lows, the volume-weighted average price, the imbalance between bids and asks. Models are unreliable at sums over long lists of numbers, and every figure the server computes is one the model cannot get wrong.
Errors that say what to do next
The API answers an unknown symbol with a bare 404. The server answers with the symbols that do exist. Ask for an exchange that does not carry a pair and the reply names the ones that do. In the tests, a question about Dogecoin, which the API does not carry, got a correct “not available” from both models after one call, not an invented price.
It says what it does not know
When there is less history than was asked for, the result says where the data begins and tells the model not to go beyond it. Asked for Bitcoin’s price a year ago, both models said the data did not go back that far.
What the tests found
The first run scored 11 out of 12. Reading the one failure showed the model had answered correctly and the server had not: it had returned a last price of zero.
The cause was in the API. An exchange that sends quotes but no trades is reported with a last price of 0, and that zero could reach the combined figure. A person would see it was wrong. A model may well report it. The server now leaves such values out, says that the exchange is sending quotes only, and compares exchanges on bid and ask, which every feed has.
Reading the API closely turned up more of the same kind: two candles returned for one period after a restart, an unknown interval silently treated as one minute, and a field documented as text that arrives as a number. Each is handled in the server, so the model never sees it. None of it needed the API to change.
Result
Five tools, eighteen unit tests, and twelve test questions that can be rerun against real models after any change. On the run reported above, both models answered all twelve correctly.
The server is public. To add it to Claude Code:
claude mcp add --transport http finstrm https://finstrm-mcp.joe-fa3.workers.dev/mcp
It has no sign-in, because the API underneath is public and read-only. A server in front of a private API would authorise each user against that API, so the assistant can do only what that user already could.
- TypeScript
- Model Context Protocol
- Cloudflare Workers
- Zod
- Vitest