Skip to main content
Glama

Execute Trade

execute_trade
Destructive

Propose or execute a potentially money-moving trade on a connected broker. If instance_id is provided, executes on a LIVE trading instance (algo-tracked) under an agent LinkedAlgo. If instance_id is omitted, executes direct on-demand trade on the selected/default broker account. If mcp_require_confirm is true, returns pending_confirmation — user must Confirm in Gogi Activity; poll get_pending_trade_status. If false, executes immediately under policy and may place a real order. Call get_policy, get_portfolio, and get_platform_disclosure first; prefer paper accounts. Use close_positions for flattening an existing position rather than inventing a sell quantity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideYesOrder direction.
symbolYesTradable ticker or instrument symbol.
quantityYesPositive units, contracts, or base-asset quantity to trade.
instance_idNoLive trading instance id (list_instances). Optional — omit for direct on-demand trading on the broker account.
linked_algo_idNoOptional LinkedAlgo id when multiple agent algos share the instance. Only applicable if instance_id is provided.
broker_account_idNoInteger `id` from list_brokers for the account the user picked (machine field). Never pass Alpaca/external account numbers.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
messageNo
successNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +  }
      +}
  2. 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"
      +}
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Adds substantial context beyond annotations: it discloses the confirm-flow (pending_confirmation, Gogi Activity, poll get_pending_trade_status), that mcp_require_confirm=false may place a REAL order immediately, and the LIVE vs direct execution semantics. This is exactly the behavioral detail annotations 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.

Conciseness4/5

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

Front-loads the core action and the mode branch clearly, but the description is fairly dense with multiple conditionals packed into long sentences. Every clause is useful, but structure could be slightly more scannable.

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?

Given a destructive, open-world, money-moving tool with a rich output schema and a confirm flow, the description covers prerequisites, execution modes, confirmation semantics, and the sibling alternative. Nothing an agent needs to call it safely 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?

Schema coverage is 100% (baseline 3), and the description further clarifies the instance_id meaning (present=live algo-tracked, absent=direct on-demand) and the confirm flag behavior, adding meaning beyond the schema. It doesn't elaborate on linked_algo_id or broker_account_id beyond schema, so not a 5.

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 (execute/propose) and resource (money-moving trade on a connected broker), and distinguishes the two execution modes (live algo-tracked via instance_id vs. direct on-demand). It also distinguishes from close_positions by naming that tool explicitly for the flattening use case.

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?

Explicitly prescribes calling get_policy, get_portfolio, and get_platform_disclosure first, prefers paper accounts, and routes to close_positions rather than inventing a sell quantity. The when-to-use-vs-alternative guidance is essentially complete.

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