Skip to main content
Glama

Build: trade a prediction market

build_prediction_trade
Read-only

Buy YES/NO shares with USDC, or sell shares back for USDC before the market closes. Includes the USDC approval when needed and a minimum-output guard.

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>",
      "id": "<id>",
      "side": "<side>",
      "action": "<action>",
      "amount": "<amount>"
    },
    "name": "build_prediction_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesprediction market id
sideYes
actionYes
amountYesUSDC to spend (buy) or shares to sell (sell), as a decimal string, e.g. "25" or "0.5"
walletYesthe agent's wallet address — the one that will sign and send the calls
slippageBpsNomax price movement, in basis points (100 = 1%)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.7/5.0
Behavior1/5

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

The annotations declare readOnlyHint=true, yet the description describes buying and selling shares and 'the USDC approval when needed' — an allowance change is an on-chain state mutation. The description never says the tool builds an unsigned transaction/call bundle rather than executing it, so the read-only annotation and the described behavior point in opposite directions. This is a serious mismatch an agent could act on incorrectly.

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?

Two compact sentences with the primary action front-loaded and the incidental behaviors (approval, min-output guard) trailing. There is no filler, though the second sentence is doing work that should have been spent clarifying execution vs. construction.

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

Completeness2/5

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

With six parameters, no output schema, and a wallet-signing requirement, the description should explain what the caller receives back (calldata? tx request? approval + trade pair?) and who signs it. None of that is covered, and the execution-vs-build ambiguity is unresolved. For a trading tool this leaves important operational gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67%, so most parameters are already documented in the schema, including the buy-spends-USDC / sell-sells-shares meaning of amount. The description's 'minimum-output guard' gestures at slippageBps but never names it or explains the trade-off. Baseline 3 is appropriate given the schema does most of the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a concrete verb and resource: buy YES/NO shares with USDC, or sell shares back for USDC. It is clear about the two directions of the trade and the settlement currency, which separates it from pure read tools like get_prediction_market. It stops short of naming how it differs from quote_prediction_trade or build_prediction_account, so an agent must infer the boundary.

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

Usage Guidelines2/5

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

The only usage constraint offered is 'before the market closes', which is a real condition but not routing guidance. There is no mention of when to quote first (quote_prediction_trade), whether an account must exist (build_prediction_account), or what to do for the sell vs buy case beyond the action enum. The agent is left to guess the workflow ordering.

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