Skip to main content
Glama
staskh

trading-skills

by staskh

ib_stop_loss

Manage downside stop-loss orders for PMCC, LEAPS, and stock positions. Use dry-run or execute conditional stops via IB Gateway, with configurable stop percentage and price mode.

Instructions

Analyze and manage downside stop-loss orders for PMCC, naked LEAPS, and stock positions.

Default mode is dry-run — no orders are placed unless execute=True. Stop price = basis × (1 - stop_pct/100). Basis is max(current_mid, avg_cost) normally; current_mid only when forced=True (can lower existing stops). In execute mode: orphan SL_FALL_ orders are cancelled, then new conditional stop orders are placed. PMCC stops use combo BAG orders (atomic LEAPS + shorts). 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. 'NVDA,QQQ') stop_pct: Loss % that triggers exit (default 40) short_near_strike_pct: Alert when spot is within this % of short strike (default 5) price_mode: Option pricing — 'mid' (bid+ask)/2 or 'last' execute: Place conditional stop-loss orders (default False = dry-run) forced: Use current mid as basis, can lower existing stops (requires execute=True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNo
forcedNo
accountNo
executeNo
symbolsNo
stop_pctNo
price_modeNomid
short_near_strike_pctNo
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses dry-run default, stop price formula, basis choice, forced behavior, cancellation of orphan orders, combo BAG orders, and prerequisite. This is rich behavioral context beyond just 'places stop-loss orders.'

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 moderately long but well-structured; the formula and arg list are efficient. No filler sentences; each sentence adds operational detail.

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?

Given 8 params and no annotations, the description covers purpose, behavior, formula, prerequisites, and all args. It doesn't detail return values, but no output schema exists and the behavior is sufficiently described for an agent to invoke correctly.

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?

Schema has 0% description coverage, so description compensates fully. It explains each parameter's purpose, format, defaults, and relationships (e.g., forced requires execute=True). This adds significant meaning beyond the schema's titles and defaults.

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 'Analyze and manage downside stop-loss orders for PMCC, naked LEAPS, and stock positions' — a specific verb+resource+scope. It clearly differentiates from sibling tools like ib_trailing_stop by specifying position types and downside protection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

The description states default dry-run mode and when execute=True is required, and mentions prerequisites (TWS running). It doesn't explicitly name alternative tools, but the context makes usage clear for downside stop-loss management. It lacks explicit exclusions but provides sufficient context.

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