Skip to main content
Glama

A Robinhood Chain token's market cap at a past block or time

brainchain_token_market_cap
Read-only

Read a Robinhood Chain token's market cap, price, and supply at the current or a past block or time by querying its Uniswap pool and transfer logs.

Instructions

What a Robinhood Chain token's market cap was at a past block or time, or is now, read from the chain: its price in dollars, its supply, and the two multiplied. The price is a pool's price right after the last swap at or before the block, read from that swap's log on Uniswap v3 or v4, in the deepest pool that pairs the token with USDG, which is counted as one dollar. The pools weighed are the ones that traded in the 300,000 blocks up to the block, about eight hours at ten blocks a second. When none did, the search goes back 100,000 blocks at a time, up to 3,000,000 blocks, and weighs the pools that traded in the first stretch that has a trade. When no pool paired with USDG traded there, the deepest pool paired with ETH or WETH is used, and its price is turned into dollars with ETH's price in ETH's deepest pool paired with USDG, read the same way at the same block and given as ethUsd. A pool's depth is depth2pctUsd: the dollar value of what it holds between 2% under its price and 2% over it, from its active liquidity after its last swap, with liquidity added or removed around that price since then taken into account, held across that band. Half of it is what a buy takes to move the price up 2%, and the other half what a sale takes to move it down 2%. A pool with a depth2pctUsd under $2,000 is marked thin: a $1,000 buy moves its price about 2% or more, so its price says little. A thin pool is still used when it is the deepest. The supply is what the token's Transfer logs say was minted less what was burned up to the block, since Robinhood Chain's public endpoint keeps no state that old. The tool checks the method at the newest block, where the same sum must equal the token's own totalSupply, and supplyCheck gives the block checked and whether the check passed. If it did not, the token's supply does not follow its Transfer logs, and no past supply or marketCapUsd is given: supplyCheck then gives what the transfers add up to and the totalSupply. Without a cut-off, supply is the token's totalSupply at the newest block. The market cap is the price times the whole supply, tokens held by the deployer or locked in a pool included. Pass the token's contract address as token; the contract of an entry from brainchain_custody_additions works. token can also be a symbol or name, such as RLUSD or Ripple USD, looked up on BitGo's lists for Robinhood Chain; when none there goes by it, on the lists the BrainChain MCP dataset records (Trust Wallet, MetaMask, LI.FI, CoinGecko, KuCoin and Gate); and when none there does either, among every token with a Uniswap pool by the symbol its contract gives itself (pool index). When exactly one token goes by it, lookup in the answer names the contract it stands for and its source, and for one found in the dataset the dataset day, block and manifest read; when several do, the answer lists them as candidates, each with its source, and reads nothing more. A symbol is whatever the token's deployer chose, so check the contract before relying on one found in the pool index. To read a past block, pass atBlock, a block number, or at, a time in ISO 8601 such as 2026-11-01T00:00:00Z, for the last block made at or before it. Without either, the tool reads the newest block. In the answer, asOf gives the block the figures are for and when it was made (at), and readAt when the chain was read. priceUsd, supply and marketCapUsd are at that block, the price as the pool stood after swap, the swap it comes from, with its block, at and transaction. pool is the pool used: its version, its address on Uniswap v3 or its id on Uniswap v4 with its hooks, the pair, pairedWith, the other token's contract address or ETH, its fee, its depth2pctUsd at the block and thin. chosen says why that pool, and pools lists the pools it was weighed against, deepest first, each with its last swap's block and its priceUsd and depth2pctUsd. token holds the contract and the name, symbol and decimals the contract gives itself. Anyone can create a pool for any token and trade in it, and whoever deployed a token chose its name, symbol and supply, so a price from a thin pool, or for a token whose origin you do not know, proves little. The token's pools, and ETH's, come from the pool index of the watcher BRAINCHAIN_WATCH_URL names, BrainChain's own by default, when it answers within 3 seconds; the blocks after the index are searched on chain, and poolIndex then gives the watcher and the block the index ran through. A pool from the index counts only when its address or id follows from its own currencies and fee, and the prices, liquidity and supply are always read from the chain. When the watcher does not answer, the tool searches the chain for every pool created for the token, and poolIndex is left out. The tool answers one request at a time, in turn with the other tools that read the chain. The first answer for a token can take half a minute when it searches for the pools itself, or about ten seconds with the index; later ones are faster for as long as the server keeps running. An answer that is not ready after 45 seconds says so, and asking again goes on from where it stopped. Free, no key and no payment. Not advice.

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": {
      "token": "<token>"
    },
    "name": "brainchain_token_market_cap"
  }
}

Input Schema

NameRequiredDescriptionDefault
atNoOptional, in place of atBlock: a time in ISO 8601, such as 2026-11-01T00:00:00Z. The figures are those at the last block made at or before it.
tokenYesThe token's contract address on Robinhood Chain, 0x followed by 40 hex characters, or its symbol or name, such as RLUSD.
atBlockNoOptional: a block number. The figures are those at the end of that block.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.16.1

TDQS

A4.5/5.0
Behavior5/5

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

With annotations only declaring readOnlyHint and openWorldHint, the description adds substantial operational context: it explains the pool-selection algorithm, the thin-pool threshold and its meaning, the supply verification against totalSupply and what happens when `supplyCheck` fails, the fallback from USDG to ETH pricing, the watcher/index behavior and 3-second timeout, concurrency ('one request at a time'), latency estimates, the 45-second timeout with resumability, and that it is free with no key. This goes far beyond what the annotations provide.

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?

The description is front-loaded with the core answer and is logically organized, but it is extremely long and dense, with nested explanations of pool depth, supply verification, lookup fallbacks, and latency. Many sentences earn their place through behavioral detail, but the volume makes it hard to scan quickly, and closing boilerplate ('Free, no key and no payment. Not advice.') is less essential.

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?

For a tool with no output schema and complex on-chain computation, the description is unusually complete: it explains how price, supply, and market cap are derived, what every major response field means (`asOf`, `readAt`, `pool`, `chosen`, `pools`, `supplyCheck`, `lookup`, `poolIndex`), how failures are surfaced, and what performance to expect. An agent has enough information to call it correctly and interpret the result.

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 all three parameters are already documented in the input schema. The description nonetheless adds meaningful semantics beyond the schema: `token` may be an address, symbol, or name; symbol resolution follows BitGo lists, then the BrainChain dataset, then the pool index; and ambiguous symbols return `candidates` rather than figures. That is useful added meaning, though the core parameter definitions are already 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?

The description opens with a specific verb-and-resource statement: it reports a Robinhood Chain token's market cap at a past block or time, or now, built from price, supply, and their product. It distinguishes itself from siblings by explaining that a contract from brainchain_custody_additions can be passed as `token`, and it names the exact output fields (`priceUsd`, `supply`, `marketCapUsd`). An agent can tell what this tool returns without opening the 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?

It clearly says to pass `atBlock` or `at` for a past block and to omit both for the newest block, and it explains how symbol/name lookup works with `lookup` versus `candidates`. It also gives practical guidance on ambiguity ('check the contract before relying on one found in the pool index') and on thin pools. It does not explicitly compare itself against most sibling tools, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.