Skip to main content
Glama

Execute Trade

execute_trade
Destructive

Money-moving broker trade (may place a real order). Optional instance_id for algo-tracked live instance; omit for on-demand on broker_account_id/default. If mcp_require_confirm, returns pending_confirmation — Confirm in Gogi Activity. Use close_positions to flatten rather than inventing a sell quantity. order_type limit/stop/stop_limit need limit_price and/or stop_price; supported types depend on the broker (Alpaca all; TradeLocker market/limit/stop; Coinbase, Kraken, OANDA, Schwab market/limit; others market) — unsupported types are refused, never sent as market. Pass a unique client_order_id so a retried call cannot place a second order. Forex/CFD quantity is in lots.

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": {
      "symbol": "<symbol>",
      "side": "<side>",
      "quantity": "<quantity>"
    },
    "name": "execute_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYesOrder direction.
symbolYesTradable ticker or instrument symbol.
quantityYesPositive units, contracts, or base-asset quantity to trade.
stop_lossNoAbsolute stop-loss price attached to this ENTRY (Alpaca, TradeLocker). Buy: below entry; sell: above.
order_typeNoDefault market.
stop_priceNoTrigger price; required for stop and stop_limit.
instance_idNoLive trading instance id (list_instances). Optional — omit for direct on-demand trading on the broker account.
limit_priceNoRequired for limit and stop_limit.
take_profitNoAbsolute take-profit price attached to this ENTRY (Alpaca, TradeLocker). Buy: above entry; sell: below.
time_in_forceNoFor non-market orders; default gtc.
linked_algo_idNoOptional LinkedAlgo id when multiple agent algos share the instance. Only applicable if instance_id is provided.
client_order_idNoYour idempotency key (letters, digits, _ -; max 48). Reusing it within 24h returns duplicate_client_order_id instead of a new order.
broker_account_idNoaccount_ref from list_brokers (e.g. "alpaca-paper-93461") for the account the user picked.

Output Schema

NameRequiredDescriptionDefault
errorNo
messageNo
successNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / client_order_id
      Added value: +{
      +  "description": "Your idempotency key (letters, digits, _ -; max 48). Reusing it within 24h returns duplicate_client_order_id instead of a new order.",
      +  "type": "string"
      +}
    • addedInput schema / properties / limit_price
      Added value: +{
      +  "description": "Required for limit and stop_limit.",
      +  "type": "number"
      +}
    • addedInput schema / properties / order_type
      Added value: +{
      +  "description": "Default market.",
      +  "enum": [
      +    "market",
      +    "limit",
      +    "stop",
      +    "stop_limit"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / stop_loss
      Added value: +{
      +  "description": "Absolute stop-loss price attached to this ENTRY (Alpaca, TradeLocker). Buy: below entry; sell: above.",
      +  "type": "number"
      +}
    • addedInput schema / properties / stop_price
      Added value: +{
      +  "description": "Trigger price; required for stop and stop_limit.",
      +  "type": "number"
      +}
    • addedInput schema / properties / take_profit
      Added value: +{
      +  "description": "Absolute take-profit price attached to this ENTRY (Alpaca, TradeLocker). Buy: above entry; sell: below.",
      +  "type": "number"
      +}
    • addedInput schema / properties / time_in_force
      Added value: +{
      +  "description": "For non-market orders; default gtc.",
      +  "enum": [
      +    "day",
      +    "gtc"
      +  ],
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / broker_account_id / description
      Previous value: -"Integer `id` from list_brokers for the account the user picked (machine field). Never pass Alpaca/external account numbers."New value: +"account_ref from list_brokers (e.g. \"alpaca-paper-93461\") for the account the user picked."
    • changedInput schema / properties / broker_account_id / type
      Previous value: -"integer"New value: +"string"
  3. Changed2 schema fields changed
    • changedOutput schema / description
      Previous value: -"Structured Gogi result. Error responses include error and message fields."New value: +"Structured result. Error responses include error and message."
    • addedOutput schema / properties
      Added value: +{
      +  "error": {
      +    "type": "string"
      +  },
      +  "message": {
      +    "type": "string"
      +  },
      +  "success": {
      +    "type": "boolean"
      +  }
      +}
  4. Changed4 schema fields changed
    • addedInput schema / properties / quantity / description
      Added value: +"Positive units, contracts, or base-asset quantity to trade."
    • addedInput schema / properties / side / description
      Added value: +"Order direction."
    • addedInput schema / properties / symbol / description
      Added value: +"Tradable ticker or instrument symbol."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "Structured Gogi result. Error responses include error and message fields.",
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, but the description adds details the annotations cannot: a confirm-gated path returning pending_confirmation that must be confirmed in Gogi Activity, and the guarantee that unsupported order types are refused rather than silently downgraded to market. The client_order_id idempotency note is especially valuable given idempotentHint=false.

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 critical fact (real money, may place a real order) is front-loaded in the first clause, and every subsequent sentence carries operational weight. It is dense to the point of feeling telegraphic with semicolons and parentheses, but no sentence is 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?

For a 13-parameter destructive trading tool, the description covers the paths an agent must not get wrong: confirmation flow, broker-specific order-type support, idempotency, and position-flattening routing. Return values need not be described because an output schema exists.

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 the baseline is 3, and the description earns above that by adding cross-cutting meaning the schema can't express: the instance_id omission behavior, the broker-dependent validity of order_type, and the units convention that forex/CFD quantity is in lots. It does not re-explain limit_price/stop_price beyond what the schema already states, which is appropriate.

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?

"Money-moving broker trade (may place a real order)" states a specific verb, resource, and the single most important consequence of calling it. It also names the sibling it is not: "Use close_positions to flatten rather than inventing a sell quantity," which removes ambiguity against a tool that could otherwise look similar.

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?

Tells the agent when to supply instance_id (algo-tracked live instance) versus omit it (on-demand on broker_account_id/default), and routes flattening to close_positions. It also gives per-broker capability rules so the agent knows which order_type values will be accepted before calling.

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