Skip to main content
Glama

Buy a basket of stock tokens

build_basket
Read-onlyIdempotent

Build unsigned buys of several stock tokens on Robinhood Chain, paid with the ETH in wallet and signed on one keyfo page. Use it when the user asks for more than one stock at once, like “buy $100 of Mag 7” or “split $50 across NVDA, TSLA, SPY”; for one stock, use build_trade. Give exactly one of: legs (each stock with its own usd or eth), or preset or split (a list of tickers) with usd or eth for the whole basket, shared equally. Preset mag7 is 7 separate stock tokens in equal shares (AAPL, MSFT, GOOGL, AMZN, NVDA, META, TSLA), not an index or a fund. 2 to 10 stocks, at least $1 each, up to 10 ETH in total, and the ETH plus gas must already be in wallet. Buys only. No keyfo fee; the route’s fees are in fees_usd. The calls expire at valid_until. The page asks for one signature only if the user’s wallet signs batches (MetaMask after a one-time account upgrade); otherwise it asks once per buy, and some buys may go through while others do not, so never promise one signature. To buy the rest later, check stock_portfolio and build only the stocks not bought. If the error has needed_slippage_pct, name the stocks and ask the user before you use it. No keyfo tool signs. When you reply, list each stock and its amount. The answer also has sign_url: a keyfo page where the user checks the transaction and signs it in their own wallet. It stays open for 15 minutes and gets a new quote itself when the price is out of date. Show that link to the user, and never ask them to paste the transaction data anywhere.

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": {
      "wallet": "<wallet>"
    },
    "name": "build_basket"
  }
}

Input Schema

NameRequiredDescriptionDefault
ethNoETH for the whole basket, with preset or split, shared equally. Up to 10 in total.
usdNoDollars of ETH for the whole basket, with preset or split, shared equally at the current ETH price.
legsNoEach stock with its own amount, like [{"token": "NVDA", "usd": 20}, {"token": "TSLA", "eth": 0.005}]. Give usd or eth on each, and leave out preset, split and the basket’s usd and eth.
splitNoTickers that share usd or eth equally, like ["NVDA", "TSLA", "SPY"].
presetNomag7: 7 separate stock tokens in equal shares (AAPL, MSFT, GOOGL, AMZN, NVDA, META, TSLA), not an index or a fund. Give usd or eth for the whole basket.
walletYesThe wallet that pays and signs. It needs the ETH for the whole basket, plus gas, on Robinhood Chain.
slippage_pctNoPrice tolerance in percent for each buy: 1 by default, from 0.1 to 10. Raise it only when the user agrees.

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?

Goes well beyond the annotations: buys are unsigned, no keyfo tool signs, calls expire at valid_until, the sign_url page lives 15 minutes and re-quotes, signing may be per-buy rather than batched so partial success is possible, and fees come from the route via fees_usd. The readOnly/idempotent hints are consistent with "build unsigned ... no keyfo tool signs" rather than contradicted.

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 purpose and the sibling fork, then constraints, then error/retry behavior, then reply guidance — a sensible ordering. It is dense and runs long with several clauses packed per sentence, so some tightening is possible, but little is genuinely redundant.

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?

No output schema exists, and the description compensates by naming the key response fields (sign_url, fees_usd, valid_until, needed_slippage_pct) and how to present them. For a 7-parameter build tool with partial-fill and expiry semantics, nothing essential to correct invocation 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 field meanings are already documented, but the description adds cross-field semantics the schema cannot express: mutual exclusivity of legs vs preset/split, equal sharing of basket-level usd/eth, mag7 being 7 distinct tokens rather than a fund, and limits of 2–10 stocks, $1 minimum each, 10 ETH cap. It does not restate slippage bounds already in the schema, which is fine.

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?

"Build unsigned buys of several stock tokens on Robinhood Chain" names a specific verb, resource, chain and execution model, and immediately contrasts with build_trade for the single-stock case. An agent can distinguish it from every listed sibling without opening a schema.

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?

It gives explicit when-to-use (user asks for more than one stock, with real example phrasings), an explicit alternative (build_trade for one stock), and hard selection rules: exactly one of `legs` vs `preset`/`split`. It also covers downstream flows — check stock_portfolio and rebuild only unbought names after a partial fill, and ask before applying needed_slippage_pct.

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