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_idNoPass the selected account_ref string from list_brokers (e.g. "alpaca-paper-93461"). Never pass an account id from get_policy.

Output Schema

NameRequiredDescriptionDefault
errorNo
messageNo
successNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / broker_account_id / description
      Previous value: -"account_ref from list_brokers (e.g. \"alpaca-paper-93461\") for the account the user picked."New value: +"Pass the selected account_ref string from list_brokers (e.g. \"alpaca-paper-93461\"). Never pass an account id from get_policy."
  2. 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"
      +}
  3. 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"
  4. 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"
      +  }
      +}
  5. 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"
      +}
  6. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructive, open-world, non-idempotent, so the safety profile is covered; the description adds what annotations cannot. It discloses the confirmation handshake, the broker-by-broker supported order_type matrix, the hard rule that unsupported types are refused and never downgraded to market, and the client_order_id idempotency behavior for retries.

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?

Front-loaded with the highest-stakes fact (real money) and structured as a sequence of operational rules rather than prose. It is dense with parentheticals and the broker support list is long, but nearly every clause carries actionable constraint information.

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, open-world trading tool with an output schema, the description covers the gaps that matter: confirmation state, idempotency, broker capability limits, and unit conventions. Nothing an agent needs in order to avoid a bad call appears to be 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?

Schema coverage is 100%, so baseline is 3, but the description adds meaning the schema does not: which brokers honor which order types, that limit/stop/stop_limit require the corresponding price, and that forex/CFD quantity is in lots. It stops short of explaining stop_loss/take_profit entry-side rules, which the schema already covers.

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 ('broker trade') and immediately flags the consequence ('may place a real order'). It also differentiates from the sibling close_positions by naming it and saying to use it to flatten instead.

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?

Gives explicit branching guidance: instance_id optional for algo-tracked live instances vs omit for on-demand on broker_account_id, and directs flattening to close_positions rather than a manual sell. The pending_confirmation / Confirm in Gogi Activity flow tells the agent what happens next when mcp_require_confirm is set.

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