Skip to main content
Glama

Prepare a signable trade intent for the agent wallet

kellian_prepare_trade

Prepare a signable trade intent for the agent wallet. There is no transaction to broadcast: sign the returned signPayload.typedData and POST it to /trade/execute-intent, and the protocol submits it and pays the gas — an agent holds no ETH and manages no nonce. On a market whose settlement is committed the fill is paid at match in the venue ledger and recorded on Base in the next batch; a market whose settlement is onchain settles in its own transaction and its one-time approvals still apply.

Examples: Prepare a signable buy intent

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": {
      "marketAddress": "<marketAddress>",
      "side": "<side>",
      "tradeType": "<tradeType>",
      "walletAddress": "<walletAddress>",
      "idempotencyKey": "<idempotencyKey>"
    },
    "name": "kellian_prepare_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYes`side` = which OUTCOME (0-indexed: 0=outcome1,1=outcome2,2=outcome3), NOT buy/sell. Buy/sell is the direction field (`type`/`tradeType`/`action`/`direction`).
amountNoExact-input size. BUY: collateral spent. SELL: outcome tokens sold. Outcome tokens carry the market collateral's own denomination — one outcome token redeems for one collateral unit — so every outcome-token quantity uses that single unit: positions.outcome1Shares/outcome2Shares/outcome3Shares, SELL amount, 409 available/requested, and outcomeTokensOut/minOutcomeTokensOut. It is also the unit the signed intent carries, so nothing is converted between the wire, the engine and the calldata. Omit when using closePercent or targetCollateralOut.
chainIdNo
tradeTypeYesTrade DIRECTION (buy/sell). Note: this same concept is named `kind` (0=buy/1=sell int) on /orderbook/* and `side`/`action`/`tradeType`/`type`/`direction` on other trade endpoints — see skill.md field-map.
proofNonceNoRequired single-use nonce for the wallet proof. Fetch from POST /api/auth/nonce; consumed on verification so the proof cannot be replayed.
slippageBpsNo
closePercentNoSELL only. Percent (1–100) of the wallet’s current position in `side` to sell; 100 closes it fully. Server sizes from the live on-chain balance. Mutually exclusive with amount and targetCollateralOut.
marketAddressYes
walletAddressYesWallet that will sign/broadcast the trade
idempotencyKeyYesRequired write-safety key; reuse it unchanged when retrying this preparation
walletSignatureNoAction-bound wallet proof. Sign the canonical 'problee-mcp-auth:…' challenge (binds agent, apiKey, tool, scope, chain, resource, payloadHash, nonce, timestamp).
signatureTimestampNoUnix timestamp (seconds) used in the signed challenge message
targetCollateralOutNoSELL only. Size the sell so its net proceeds reach ~this much collateral (wei); server sizes from the live balance. Mutually exclusive with amount and closePercent.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations it discloses traits an agent could not infer: there is nothing to broadcast, the protocol pays gas so no ETH is needed, no nonce is managed locally, committed-settlement fills pay at match in the venue ledger with Base recording in the next batch, and onchain settlement still requires one-time approvals. This is exactly the kind of operational context annotations alone cannot carry.

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 sentences are dense and front-loaded, leading with the core action and then the follow-up step and settlement nuance. The trailing 'Examples: Prepare a signable buy intent' is a truncated, low-value fragment that does not earn its place.

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 13-parameter mutation tool with an output schema and annotations, the description covers the end-to-end lifecycle and the absence of gas/nonce burden well. It omits intent expiry and any mention that the sign-then-execute flow corresponds to a sibling MCP tool rather than only an HTTP route, which is a meaningful gap in a crowded tool list.

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 description coverage is 77%, so the schema already documents most fields in detail, and the description adds nothing about the mutually exclusive sizing inputs (amount vs closePercent vs targetCollateralOut) or the proof/nonce parameters. Baseline 3 is appropriate where the schema does the heavy lifting and the prose does not compensate further.

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 states a specific verb and resource ('Prepare a signable trade intent') and immediately clarifies the scope: no broadcast happens here, only signing of the returned signPayload.typedData. That distinguishes it from the execute step and from the batch prepare sibling without opening either 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 gives an explicit two-step workflow (sign the typed data, then POST to /trade/execute-intent) and explains the two settlement regimes that change post-trade behavior. It stops short of naming sibling tools such as kellian_execute_trade_intent, kellian_prepare_trades_batch, or kellian_simulate_trade as alternatives, leaving that routing to inference.

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