Skip to main content
Glama

Place a market order

place_market_order

Place an IOC market order. It executes as an IOC limit at a worst-acceptable price mirrored around the oracle by side — BUY caps ABOVE the oracle, SELL below — at slippageBps distance (default 500 = 5%). Fills happen at book prices; the cap only limits how deep the sweep goes. reduceOnly closes an existing position. Returns confirmation with the REAL outcome verified via the indexer (filled / partially_filled / unfilled / pending): broadcast code: 0 only means the tx was accepted — an IOC order cancels UNFILLED when the book is entirely beyond the slippage cap (thin/spread market). Always report from confirmation.outcome, not code; if unfilled or partially_filled, retry with a larger slippageBps to sweep deeper; if pending, the indexer is lagging — wait a few seconds and re-check before concluding.

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": {
      "market": "<market>",
      "side": "<side>",
      "size": "<size>"
    },
    "name": "place_market_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYes
sizeYesSize in base units
marketYesMarket ticker, e.g. BTC-USD
confirmNoVerify the real fill via the indexer after broadcast (default true).
clientIdNo
reduceOnlyNo
slippageBpsNoMax slippage vs oracle, in bps (default 500). BUY bounds above the oracle, SELL below; raise to sweep a thin book, up to the server maximum (whoami.configuredLimits.maxSlippageBps).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / slippageBps / description
      Previous value: -"Max slippage vs oracle, in bps (default 500). BUY bounds above the oracle, SELL below; raise to sweep a thin book."New value: +"Max slippage vs oracle, in bps (default 500). BUY bounds above the oracle, SELL below; raise to sweep a thin book, up to the server maximum (whoami.configuredLimits.maxSlippageBps)."
  2. Changed1 schema field changed
    • addedInput schema / properties / market / pattern
      Added value: +"^[A-Z0-9]{1,20}-[A-Z0-9]{1,20}$"
  3. Changed1 schema field changed
    • changedInput schema / properties / slippageBps / description
      Previous value: -"Max slippage vs oracle, in bps"New value: +"Max slippage vs oracle, in bps (default 500). BUY bounds above the oracle, SELL below; raise to sweep a thin book."
  4. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Far exceeds the annotations: it discloses that the order is IOC, that the cap is mirrored around the oracle by side, that fills occur at book prices, that IOC orders cancel unfilled in thin markets, and that broadcast `code: 0` only means acceptance while the real outcome lives in `confirmation`. This is exactly the behavioral context the readOnly/idempotent/destructive hints cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and order type, then progressively adds mechanics, return semantics, and retry rules. Despite its density, every sentence carries decision-relevant information with no filler.

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?

Although there is no output schema, the description documents the `confirmation.outcome` values (filled/partially_filled/unfilled/pending) and how to act on each. For a non-idempotent mutation tool with 7 parameters, nothing an agent needs to call and interpret it correctly 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?

With 57% schema coverage, the description compensates well: it explains reduceOnly as closing an existing position (bare in the schema) and explains slippageBps directionality and default. clientId and confirm remain unaddressed in prose, keeping this short of full coverage.

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 ('Place an IOC market order') and immediately qualifies it as an IOC limit capped around the oracle, which distinguishes it from place_limit_order and place_stop_loss. An agent can tell what this tool does 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 Guidelines3/5

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

Gives operational guidance for the failure paths (raise slippageBps when unfilled/partially_filled, re-check when pending) and notes reduceOnly closes an existing position. However, it never states when to choose this over the sibling place_limit_order or place_stop_loss, so the alternative-selection guidance is only implied by the IOC wording.

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