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.

Capabilities

Features and capabilities supported by this server

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.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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