Skip to main content
Glama

Buy or sell at market (unsigned txs)

market_trade
Read-only

Build a market buy or sell of a listed stock token on The River's best-execution route (the same route as the site's trade ticket: KyberSwap across DEX pools, else the token's listed pool). A buy says what it spends (spend, base units of USDC/USDG); a sell says what it sells (quantity, base units of the token). Returns the quote (price, minimum out after slippage, fee, venue) and an exact approve only when the allowance is short, then the swap. slippageBps defaults to 100 (1%). Returns unsigned transactions for the user to sign in their own wallet, in order; nothing is sent or signed here.

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": {
      "chainId": "<chainId>",
      "owner": "<owner>",
      "side": "<side>",
      "token": "<token>"
    },
    "name": "market_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYes
ownerYes0x... address
spendNoBuy only: base units to spend, e.g. "25000000" = 25 USDC
tokenYesThe stock token, 0x...
chainIdYes8453 Base, 4663 Robinhood Chain
quantityNoSell only: token base units to sell
slippageBpsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Adds meaningful behavior beyond the annotations: it explains why readOnlyHint=true applies ('nothing is sent or signed here'), that transactions are returned unsigned and in order, and that an exact approve is emitted only when the allowance is short. It does not cover failure modes (unlisted token, insufficient balance) or auth requirements, so it stops short of 5.

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?

The core action and the unsigned-transaction caveat are front-loaded, and every sentence carries information (route, buy/sell inputs, return shape, slippage default). The middle sentence packs the quote/approve/swap return sequence densely, but nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter mutation-shaped builder with no output schema, the description covers the return shape (quote fields, approve, swap) and the ordering of returned transactions, which is the essential missing piece. Gaps remain around error/edge behavior and the max slippageBps bound, but the call can be made correctly from this.

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?

Adds meaning beyond the 71%-covered schema: it disambiguates spend vs quantity by side, specifies their base units (USDC/USDG vs token), and documents the slippageBps default of 100 (1%), which the schema does not state. Only chainId/owner semantics are left entirely to 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 ('Build a market buy or sell of a listed stock token') plus the routing detail (KyberSwap across DEX pools, else the token's listed pool). An agent can distinguish this from place_limit_order, start_recurring_buy, or withdraw without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clarifies the buy-vs-sell selection rule ('a buy says what it spends... a sell says what it sells'), which is real usage guidance. However, it never states when to prefer this over the sibling market-entry tools (place_limit_order, start_recurring_buy) or any prerequisite conditions, so routing between siblings is left implied.

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