Skip to main content
Glama
staskh

trading-skills

by staskh

ib_trailing_stop

Manage Interactive Brokers trailing stop orders for stocks and naked LEAPS positions; dry-run previews order changes before execution.

Instructions

Manage IB native TRAIL orders for stocks and naked LEAPS positions.

Default mode is dry-run — no orders are placed unless execute=True. PMCC positions are excluded; use ib_stop_loss for those. Requires TWS or IB Gateway running locally.

Args: port: IB port (7496 for live, 7497 for paper) account: Specific account ID (optional) symbols: Comma-separated symbols to filter (optional, e.g. 'JOBY,TSLA') trail_pct: Trail amount as % of reference price (default 20, mutually exclusive with trail_amt) trail_amt: Trail amount in dollars (mutually exclusive with trail_pct) price_mode: Option pricing — 'mid' (bid+ask)/2 or 'last' (LEAPS only) execute: Cancel orphan TS_ orders and place new TRAIL orders (default False = dry-run) forced: Cancel and replace existing TS_ orders with current parameters (requires execute=True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNo
forcedNo
accountNo
executeNo
symbolsNo
trail_amtNo
trail_pctNo
price_modeNomid
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the dry-run default, the effect of execute=True ('Cancel orphan TS_ orders and place new TRAIL orders'), and forced behavior ('Cancel and replace existing TS_ orders with current parameters'). However, it does not describe the return value or what happens to previously placed orders when not forced, leaving some behavioral ambiguity.

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?

The description is well-structured: a purpose statement, critical safety note, exclusion/alternative, and a concise parameter list. Every sentence earns its place, and the parameter list is formatted as easy-to-scan items. No fluff or redundancy.

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 an 8-parameter trading tool with no annotations or output schema, the description covers purpose, usage, prerequisites, and parameter semantics thoroughly. It lacks a description of the return value or output format (e.g., what happens after execution), which would make it fully complete. Given the tool's complexity, this is a minor but noticeable gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description provides detailed semantic meaning for all 8 parameters, including defaults, examples, mutual exclusivity (trail_pct vs trail_amt), and mode-specific behavior (price_mode 'last' for LEAPS only). This fully compensates for the missing schema descriptions and goes beyond listing names.

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 opens with a specific verb+resource: 'Manage IB native TRAIL orders for stocks and naked LEAPS positions.' It clearly distinguishes from the sibling tool ib_stop_loss by scoping to stocks/naked LEAPS and explicitly excluding PMCC positions, which is a strong differentiator.

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?

The description provides explicit guidance: 'Default mode is dry-run — no orders are placed unless execute=True' covers safe invocation, and 'PMCC positions are excluded; use ib_stop_loss for those' names an alternative tool for the excluded case. It also states a prerequisite (TWS or IB Gateway running locally), which is actionable context for when to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/staskh/trading_skills'

If you have feedback or need assistance with the MCP directory API, please join our Discord server