Skip to main content
Glama
staskh

trading-skills

by staskh

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MASSIVE_API_KEYNoAPI key for Massive (formerly Polygon.io) to enable whale-hunting features.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_versionA

Return the current version of the trading-skills package.

stock_quoteB

Get real-time stock quote with price, volume, change, and key metrics.

Args: symbol: Ticker symbol (e.g., AAPL, MSFT)

price_historyB

Get historical OHLCV price data.

Args: symbol: Ticker symbol period: Time period (1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max) interval: Data interval (1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo)

news_sentimentA

Get recent news headlines for a stock.

Args: symbol: Ticker symbol limit: Number of articles to return (default 10)

insider_tradingA

Get insider trading activity (SEC Form 4) for one or more stocks.

Returns transactions with insider name, role, transaction type, shares, price, value, date, and net buying/selling sentiment summary.

Args: symbols: Single ticker or comma-separated list (e.g., 'NVDA' or 'NVDA,PLTR,GOOG') days_back: Trailing days to look back (default 90)

fundamentalsA

Get fundamental financial data including metrics, financials, and earnings.

Args: symbol: Ticker symbol data_type: Type of data - 'all', 'info', 'financials', or 'earnings'

piotroski_scoreA

Calculate Piotroski F-Score (0-9) evaluating financial strength.

Scores 9 fundamental criteria including profitability, leverage, liquidity, and operating efficiency.

Args: symbol: Ticker symbol

earnings_calendarA

Get upcoming earnings dates with timing (BMO/AMC) and EPS estimates.

Args: symbols: Single symbol or comma-separated list (e.g., 'AAPL' or 'AAPL,MSFT,GOOGL')

technical_indicatorsA

Compute technical indicators for a stock.

Args: symbol: Ticker symbol or comma-separated list period: Historical period (1mo, 3mo, 6mo, 1y) indicators: Comma-separated indicators (rsi, macd, bb, sma, ema, atr, adx) include_earnings: Include earnings data

price_correlationA

Compute price correlation matrix between multiple symbols.

Useful for portfolio diversification analysis.

Args: symbols: Comma-separated ticker symbols (minimum 2) period: Historical period (1mo, 3mo, 6mo, 1y)

risk_assessmentA

Assess risk metrics including volatility, beta, VaR, and drawdown.

Args: symbol: Ticker symbol period: Analysis period (default 1y) position_size: Optional position size in dollars for position-specific metrics

option_expiriesB

List available option expiration dates for a symbol.

Args: symbol: Ticker symbol

option_chainA

Get option chain data (calls and puts) for a specific expiration.

Args: symbol: Ticker symbol expiry: Expiration date (YYYY-MM-DD)

option_greeksA

Calculate option Greeks (delta, gamma, theta, vega) using Black-Scholes.

Computes implied volatility from market price if provided.

Args: spot: Current underlying price strike: Option strike price option_type: 'call' or 'put' expiry: Expiration date (YYYY-MM-DD) - use this OR dte dte: Days to expiration (alternative to expiry) market_price: Option market price (for IV calculation) volatility: Override volatility (decimal, e.g., 0.30) rate: Risk-free rate (default 0.05)

spread_verticalB

Analyze vertical spread (bull/bear call/put spread).

Args: symbol: Ticker symbol expiry: Expiration date (YYYY-MM-DD) option_type: 'call' or 'put' long_strike: Strike price for long leg short_strike: Strike price for short leg

spread_diagonalA

Analyze diagonal spread (different expiries and strikes).

Includes Poor Man's Covered Call/Put analysis.

Args: symbol: Ticker symbol option_type: 'call' or 'put' long_expiry: Long leg expiration (YYYY-MM-DD) long_strike: Long leg strike short_expiry: Short leg expiration (YYYY-MM-DD) short_strike: Short leg strike

spread_straddleC

Analyze long straddle (buy call + put at same strike).

Args: symbol: Ticker symbol expiry: Expiration date (YYYY-MM-DD) strike: Strike price for both legs

spread_strangleA

Analyze long strangle (buy OTM call + OTM put).

Args: symbol: Ticker symbol expiry: Expiration date (YYYY-MM-DD) put_strike: Put strike (below current price) call_strike: Call strike (above current price)

spread_iron_condorA

Analyze iron condor (sell strangle + buy protective wings).

Args: symbol: Ticker symbol expiry: Expiration date (YYYY-MM-DD) put_long: Long put strike (lowest) put_short: Short put strike call_short: Short call strike call_long: Long call strike (highest)

scan_bullishA

Scan symbols for bullish trends using SMA, RSI, MACD, ADX.

Returns top N symbols ranked by composite bullish score.

Args: symbols: Comma-separated ticker symbols top_n: Number of top symbols to return (default 30) period: Historical period (1mo, 3mo, 6mo)

scan_pmccA

Scan symbols for Poor Man's Covered Call suitability.

Analyzes LEAPS and short call options for delta, liquidity, spread tightness, IV, and yield.

Args: symbols: Comma-separated ticker symbols min_leaps_days: Minimum days for LEAPS expiry (default 270) leaps_delta: Target delta for LEAPS (default 0.80) short_delta: Target delta for short call (default 0.20)

whale_huntingA

Detect institutional whale option activity for a given underlying.

Uses a two-step approach:

  1. Crude scan via Yahoo Finance — finds contracts with anomalous daily investment.

  2. Precise drill-down via Massive API — per-second bars for each candidate.

Requires MASSIVE_API_KEY environment variable for per-second data. Falls back to Yahoo-only daily data if unavailable.

Args: symbol: Underlying ticker (e.g. AAPL, NVDA, SPY) max_months: Max months until expiration to consider (default 2) trading_date: Date to analyze YYYY-MM-DD (default: latest trading day) sigma_z: Modified Z-Score threshold for outlier detection (default 3.5) summary: If True, include per-ticker aggregate summary in result

report_stockA

Generate comprehensive stock analysis data with trend, PMCC, and fundamental analysis.

Returns detailed data including bullish score, PMCC viability, fundamentals, Piotroski F-Score, spread strategies, and an overall recommendation.

Args: symbol: Ticker symbol (e.g., AAPL, MSFT)

ib_accountA

Get account summary from Interactive Brokers.

Returns cash balance, buying power, net liquidation value, and margin info. Requires TWS or IB Gateway running locally.

Args: port: IB port (7496 for live, 7497 for paper)

ib_portfolioA

Get portfolio positions from Interactive Brokers.

Returns all positions including stocks and options with market prices. Requires TWS or IB Gateway running locally.

Args: port: IB port (7496 for live, 7497 for paper) account: Specific account ID (optional, uses first if not specified)

ib_find_short_rollA

Find roll, spread, or covered call/put candidates using real-time IB data.

Auto-detects mode based on existing positions:

  • Short option found: roll candidates with credit/debit analysis

  • Long option found: short candidates to create a vertical spread

  • Long stock found: covered call/put candidates Requires TWS or IB Gateway running locally.

Args: symbol: Ticker symbol (e.g., GOOG) port: IB port (7496 for live, 7497 for paper) account: Account ID (optional) strike: Current short strike (optional, auto-detects from portfolio) expiry: Current expiry YYYYMMDD (optional, auto-detects from portfolio) right: 'C' for call or 'P' for put (default: C)

ib_portfolio_action_reportA

Analyze portfolio positions with earnings dates and risk assessment.

Fetches positions, groups into spreads, categorizes by urgency, and returns structured analysis with recommendations. Requires TWS or IB Gateway running locally.

Args: port: IB port (7496 for live, 7497 for paper) account: Specific account ID (optional)

ib_option_expiriesA

List available option expiration dates from Interactive Brokers.

Requires TWS or IB Gateway running locally.

Args: symbol: Ticker symbol port: IB port (7496 for live, 7497 for paper)

ib_option_chainA

Get option chain data from Interactive Brokers with real-time quotes.

Returns calls and puts with strikes, bids, asks, volume, and implied volatility. Requires TWS or IB Gateway running locally.

Args: symbol: Ticker symbol expiry: Expiration date (YYYYMMDD) port: IB port (7496 for live, 7497 for paper)

ib_delta_exposureA

Calculate delta-adjusted notional exposure across all IBKR accounts.

Computes option deltas using Black-Scholes and reports long/short exposure by account and underlying symbol. Requires TWS or IB Gateway running locally.

Args: port: IB port (7496 for live, 7497 for paper)

ib_pmcc_advisorA

Analyze PMCC (diagonal call spread) positions and recommend roll actions.

For each spread: reports assignment probability, P&L projections, roll candidates ranked by delta improvement and credit, and a comparison table. 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,WMT') min_roll_dte: Minimum DTE for roll candidates (default 7) price_mode: Option price source — 'mid' (bid+ask)/2 or 'last'

ib_collarA

Generate tactical collar strategy report for protecting PMCC positions.

Analyzes existing long call (PMCC) positions and recommends put protection through earnings or high-risk events. Requires TWS or IB Gateway running locally.

Args: symbol: Ticker symbol (e.g., AAPL) port: IB port (7496 for live, 7497 for paper) account: Account ID (optional)

ib_stop_lossA

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)

ib_trailing_stopA

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)

ib_trades_historyA

Fetch trade executions from Interactive Brokers.

Returns individual trade executions with fills, commissions, and realized P&L, plus aggregated summary by symbol. Uses live API (~7 days history) by default, or FlexReport for full history when token and query ID are provided. Requires TWS or IB Gateway running locally.

Args: port: IB port (7496 for live, 7497 for paper) account: Specific account ID (optional, fetches all if not specified) symbol: Filter trades by symbol (e.g., AAPL) start_date: Start date in YYYY-MM-DD format (default: Jan 1 of current year) end_date: End date in YYYY-MM-DD format (default: today) flex_token: FlexReport token for extended history beyond ~7 days flex_query_id: FlexReport query ID (required with flex_token). Pass a list of IDs to merge and deduplicate results from multiple queries — useful for spans exceeding the FlexReport 365-day per-query limit.

ib_0dte_ema_vixA

Find (and optionally place) the best 0DTE credit spread via the EMA + VIX/VXN strategy.

Reads 30-min IB bars + the live vol index, applies the vol gate, then auto-selects bull_put or bear_call from the EMA9/EMA21 cross before ranking spreads. NDX/QQQ are gated on VXN (Nasdaq-100 vol); all other symbols on VIX. Returns success=False with a reason when a gate blocks the trade (VIX-SKIP / no-cross / EMA-Dn-no-RR / missing-bars).

Default is a bare EMA cross runnable any time of day; enable the optional confirmation gates per call. Default is a dry run — pass execute=True to place a live combo order with the automatic OCA exit bracket. Requires TWS or IB Gateway running locally.

Args: symbol: Underlying (e.g. NDX, SPX, RUT, QQQ, SPY) budget: Max capital at risk in dollars (default 50000) port: IB port (7496 for live, 7497 for paper) vix_threshold: Skip if vol index >= this. Default is per-index: VXN 35 for NDX/QQQ, VIX 20 otherwise. target_delta: Short-leg delta target (default 0.12) rr_gate: Require red→red (9:30 + 10:00 ET bars both red) to confirm a Bear Call time_gate: Require today's 9:30 + 10:00 ET bars (run at 10:30 ET+) and anchor the EMA-cross lookback to the 10:00 ET bar max_width: Cap the strike width in dollars (NDX typically 100) gex: Compute the dealer gamma-exposure profile top: Number of candidates to return (default 5) account: IBKR account for execution (required with execute when >1 managed account) execute: Place the chosen spread as a live combo order (default False = dry run) pick: 1-based rank of the candidate to execute (default 1 = best) limit_frac: Walk between the marketable combo credit (0) and mid (1.0) at execution

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.4/5.0

Scored across 36 tools

Disambiguation3/5

There are two parallel sets of option tools (ib_* and non-ib) that overlap heavily: ib_option_chain/option_chain, ib_option_expiries/option_expiries, ib_pmcc_advisor/scan_pmcc, ib_find_short_roll/spread_diagonal. The ib_* tools are distinguished by requiring TWS/IB Gateway, but an agent could easily confuse which to use for a given task, especially since both sets cover similar option analysis territory.

Naming Consistency3/5

Most tools follow a noun-based or verb_noun pattern (stock_quote, price_history, option_chain, spread_vertical, ib_account), but there is inconsistency: some use verbs (scan_bullish, whale_hunting, get_version), some use nouns (fundamentals, piotroski_score), and the ib_* prefix is applied inconsistently (ib_delta_exposure vs delta_exposure doesn't exist, but ib_option_chain vs option_chain both exist). The naming is readable but not predictable.

Tool Count2/5

36 tools is heavy for a trading server, and many are near-duplicates (ib_option_chain/option_chain, ib_option_expiries/option_expiries, ib_pmcc_advisor/scan_pmcc, ib_find_short_roll/spread_diagonal). The count feels bloated rather than well-scoped, though each tool does have a specific function.

Completeness4/5

The server covers a broad trading workflow: market data, fundamentals, options analysis, spread strategies, scanning, and IBKR account management. Minor gaps exist (no explicit order placement for non-IB tools, no portfolio-level risk aggregation beyond ib_portfolio_action_report), but the core domain of stock/option analysis and IBKR integration is well covered.

Maintenance

ActivityActive
ResponsivenessSlow