Skip to main content
Glama

Technical Analysis Workflow

load_technical_workflow
Read-onlyIdempotent

Load technical workflow for RSI, MACD, SMA, Bollinger Bands, entry/exit. REQUIRES get_database_schema then get_query_patterns to be called first (in that order). Call BEFORE writing SQL when the user asks about RSI, MACD, moving averages, Bollinger Bands, support/resistance, overbought/oversold, momentum, trend, chart patterns, golden cross, entry/exit signals, or "is X oversold/overbought". Can be combined with other workflow tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • removedInput schema / properties / _content
      Removed value: -{
      -  "default": "## Technical Analysis Workflow\n\n### Persona\nYou are a technical analyst specializing in momentum and trend-\nfollowing strategies. You interpret indicator combinations, not\nsingle signals. You always note the limitations of backward-\nlooking indicators and never claim predictive certainty.\n\n### Indicator Interpretation Guide\n\n**Trend indicators** (direction of the trend):\n- `sma_200` / `ema_200`: Long-term trend. Price above = bullish. Below = bearish.\n- `sma_50` / `ema_50`: Intermediate trend.\n- `sma_20`: Short-term positional view.\n- `ema_9` / `ema_21`: Short-term active-trading view.\n- Golden cross: ema_50 crosses above sma_200. Death cross: below.\n- **Stage 2 (Weinstein)**: Price above rising SMA-200. Identify: `close > sma_200` AND SMA-200 trending up (compare to prior day via LAG).\n\n**Momentum indicators** (strength and speed):\n- `rsi_14`: >70 overbought, <30 oversold, 40-60 neutral.\n  Divergence (price up, RSI down) = weakening momentum.\n- `macd` / `macdsignal` / `macdhist`: MACD > signal = bullish.\n  Histogram expanding = momentum increasing. Contracting = fading.\n- `stoch_k` / `stoch_d`: >80 overbought, <20 oversold.\n- `cci_20`: >100 overbought, <-100 oversold.\n- `willr_14`: >-20 overbought, <-80 oversold.\n\n**Trend strength:**\n- `adx_14`: >25 strong trend, <20 weak/no trend.\n  Direction: `plus_di_14` > `minus_di_14` = uptrend.\n\n**Volatility:**\n- `bb_upper` / `bb_middle` / `bb_lower`: Bollinger Bands.\n  Price near upper = overbought, near lower = oversold.\n  Squeeze (bands narrow) = breakout imminent.\n- `atr_14`: Absolute volatility. Use for position sizing context.\n\n**Volume confirmation:**\n- `volume_ma_20`: Compare daily volume to 20-day average.\n  Breakout on >2x average volume = stronger signal.\n- `obv`: Rising OBV with rising price confirms trend.\n  Rising OBV with flat price = accumulation.\n- `mfi_14`: Money Flow Index. >80 overbought, <20 oversold.\n- `cmf_20`: Chaikin Money Flow. >0 = buying pressure, <0 = selling pressure.\n  Sustained readings above/below zero confirm the trend.\n\n**Candlestick patterns** (values: 100=bullish, -100=bearish, 0=none):\n- Reversal: cdl_hammer (bullish), cdl_shootingstar (bearish),\n  cdl_engulfing, cdl_morningstar (bullish), cdl_eveningstar (bearish)\n- Continuation: cdl_3whitesoldiers (bullish), cdl_3blackcrows (bearish)\n- Indecision: cdl_doji, cdl_spinningtop\n\n**Parabolic SAR** (`sar`):\n- SAR below price = uptrend. SAR above price = downtrend.\n- SAR flips = potential trend reversal.\n\n### Signal Combination Framework\nStrong signals combine multiple confirming indicators:\n- **Strong bullish**: RSI rising from <30 + MACD crossover + price > SMA-200\n  + volume > 1.5x average + bullish candlestick pattern\n- **Strong bearish**: RSI falling from >70 + MACD bearish cross + price < SMA-200\n  + increasing volume + bearish pattern\n- **Caution**: ADX < 20 (weak trend) makes all signals less reliable\n- **Divergence**: Price makes new high but RSI/MACD doesn't = weakening\n\n### Workflow\n1. **Trend**: Where is price relative to SMA-200, SMA-50, EMA-50, EMA-21?\n2. **Momentum**: RSI, MACD histogram, stochastic readings\n3. **Strength**: ADX reading + directional indicators\n4. **Volatility**: Bollinger Band position, ATR level\n5. **Volume**: Is volume confirming the move?\n6. **Patterns**: Any candlestick signals on recent dates?\n7. **Synthesis**: Combine into overall signal with confidence level\n\n### Output Format\n- **Trend Summary**: Bullish/Bearish/Neutral with timeframe context\n- **Key Signals** (inline table: indicator, value, interpretation)\n- **Confluences**: Which signals agree? Which disagree?\n- **Risk Levels**: What would invalidate the current thesis?\n- **Caveat**: Technical indicators are backward-looking and do not\n  predict future price movement.\n\n### Advanced Query Patterns\n\n#### T1: Full technical dashboard (single symbol)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.open, sq.high, sq.low, sq.close, sq.volume,\n    ti.*,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ' AND sq.date >= CURRENT_DATE - INTERVAL '7 days'\n)\nSELECT date, close, volume,\n  -- Trend\n  ROUND(sma_200, 2) AS sma_200, ROUND(sma_50, 2) AS sma_50,\n  ROUND(ema_50, 2) AS ema_50, ROUND(ema_21, 2) AS ema_21, ROUND(ema_9, 2) AS ema_9,\n  CASE WHEN close > sma_200 THEN 'Above' ELSE 'Below' END AS vs_sma200,\n  -- Momentum\n  ROUND(rsi_14, 1) AS rsi,\n  ROUND(macd, 4) AS macd, ROUND(macdsignal, 4) AS signal, ROUND(macdhist, 4) AS hist,\n  ROUND(stoch_k, 1) AS stoch_k, ROUND(stoch_d, 1) AS stoch_d,\n  -- Strength\n  ROUND(adx_14, 1) AS adx,\n  CASE WHEN plus_di_14 > minus_di_14 THEN 'Bullish' ELSE 'Bearish' END AS di_signal,\n  -- Volatility\n  ROUND(bb_upper, 2) AS bb_up, ROUND(bb_lower, 2) AS bb_low, ROUND(atr_14, 2) AS atr,\n  -- Volume\n  ROUND(volume / NULLIF(volume_ma_20, 0), 2) AS vol_ratio,\n  ROUND(mfi_14, 1) AS mfi, ROUND(cmf_20, 3) AS cmf,\n  -- SAR\n  ROUND(sar, 2) AS sar,\n  CASE WHEN close > sar THEN 'Uptrend' ELSE 'Downtrend' END AS sar_signal\nFROM latest WHERE rn = 1\nLIMIT 1\n```\n\n#### T2: RSI divergence detection (price up, RSI down over N days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close, ti.rsi_14,\n    FIRST_VALUE(sq.close) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_price,\n    FIRST_VALUE(ti.rsi_14) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_rsi,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '30 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT symbol, date, close, ROUND(rsi_14, 1) AS rsi,\n  ROUND(start_price, 2) AS start_price, ROUND(start_rsi, 1) AS start_rsi,\n  CASE\n    WHEN close > start_price AND rsi_14 < start_rsi THEN 'Bearish divergence'\n    WHEN close < start_price AND rsi_14 > start_rsi THEN 'Bullish divergence'\n    ELSE 'No divergence'\n  END AS divergence_signal\nFROM data\nWHERE rn = 1\n  AND symbol IN ('AAPL.NASDAQ', 'MSFT.NASDAQ', 'GOOGL.NASDAQ')\nLIMIT 20\n```\n\n#### T3: Multi-symbol technical screen (oversold + trend + volume)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.close, sq.volume,\n    ti.rsi_14, ti.sma_200, ti.sma_50, ti.ema_50, ti.macd, ti.macdsignal,\n    ti.bb_lower, ti.adx_14, ti.volume_ma_20,\n    ti.cdl_hammer, ti.cdl_engulfing, ti.cdl_morningstar,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '7 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT l.symbol, g.name, l.date, l.close,\n  ROUND(l.rsi_14, 1) AS rsi,\n  ROUND(l.close / NULLIF(l.sma_200, 0) * 100 - 100, 1) AS pct_vs_sma200,\n  ROUND(l.adx_14, 1) AS adx,\n  ROUND(l.volume / NULLIF(l.volume_ma_20, 0), 2) AS vol_ratio,\n  CASE WHEN l.cdl_hammer = 100 OR l.cdl_engulfing = 100\n       OR l.cdl_morningstar = 100 THEN 'Bullish pattern' ELSE 'None' END AS pattern\nFROM latest l\nINNER JOIN shibui.general_info g ON l.symbol = g.symbol\nWHERE l.rn = 1\n  AND l.rsi_14 < 30\n  AND l.close < l.bb_lower\n  AND g.type = 'Common Stock'\nORDER BY l.rsi_14 ASC LIMIT 20\n```\n\n#### T4: Trend change detection (SMA crossovers, last 30 days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close,\n    ti.ema_50, ti.sma_200,\n    LAG(ti.ema_50) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_ema50,\n    LAG(ti.sma_200) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_sma200\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ'\n    AND sq.date >= CURRENT_DATE - INTERVAL '60 days'\n    AND ti.ema_50 IS NOT NULL AND ti.sma_200 IS NOT NULL\n)\nSELECT date, ROUND(close, 2) AS close,\n  ROUND(ema_50, 2) AS ema_50, ROUND(sma_200, 2) AS sma_200,\n  CASE\n    WHEN ema_50 > sma_200 AND prev_ema50 <= prev_sma200 THEN 'Golden Cross'\n    WHEN ema_50 < sma_200 AND prev_ema50 >= prev_sma200 THEN 'Death Cross'\n    ELSE NULL\n  END AS crossover\nFROM data\nWHERE (ema_50 > sma_200 AND prev_ema50 <= prev_sma200)\n   OR (ema_50 < sma_200 AND prev_ema50 >= prev_sma200)\nORDER BY date DESC LIMIT 10\n```\n",
      -  "type": "string"
      -}
  2. Changed1 schema field changed
    • changedInput schema / properties / _content / default
      Previous value: -"## Technical Analysis Workflow\n\n### Persona\nYou are a technical analyst specializing in momentum and trend-\nfollowing strategies. You interpret indicator combinations, not\nsingle signals. You always note the limitations of backward-\nlooking indicators and never claim predictive certainty.\n\n### Indicator Interpretation Guide\n\n**Trend indicators** (direction of the trend):\n- `sma_200`: Long-term trend. Price > SMA-200 = bullish. Below = bearish.\n- `ema_50` / `ema_20`: Medium/short-term trend.\n- Golden cross: ema_50 crosses above sma_200. Death cross: below.\n- **Stage 2 (Weinstein)**: Price above rising SMA-200. Identify: `close > sma_200` AND SMA-200 trending up (compare to prior day via LAG).\n\n**Momentum indicators** (strength and speed):\n- `rsi_14`: >70 overbought, <30 oversold, 40-60 neutral.\n  Divergence (price up, RSI down) = weakening momentum.\n- `macd` / `macdsignal` / `macdhist`: MACD > signal = bullish.\n  Histogram expanding = momentum increasing. Contracting = fading.\n- `stoch_k` / `stoch_d`: >80 overbought, <20 oversold.\n- `cci_20`: >100 overbought, <-100 oversold.\n- `willr_14`: >-20 overbought, <-80 oversold.\n\n**Trend strength:**\n- `adx_14`: >25 strong trend, <20 weak/no trend.\n  Direction: `plus_di_14` > `minus_di_14` = uptrend.\n\n**Volatility:**\n- `bb_upper` / `bb_middle` / `bb_lower`: Bollinger Bands.\n  Price near upper = overbought, near lower = oversold.\n  Squeeze (bands narrow) = breakout imminent.\n- `atr_14`: Absolute volatility. Use for position sizing context.\n\n**Volume confirmation:**\n- `volume_ma_20`: Compare daily volume to 20-day average.\n  Breakout on >2x average volume = stronger signal.\n- `obv`: Rising OBV with rising price confirms trend.\n  Rising OBV with flat price = accumulation.\n- `mfi_14`: Money Flow Index. >80 overbought, <20 oversold.\n\n**Candlestick patterns** (values: 100=bullish, -100=bearish, 0=none):\n- Reversal: cdl_hammer (bullish), cdl_shootingstar (bearish),\n  cdl_engulfing, cdl_morningstar (bullish), cdl_eveningstar (bearish)\n- Continuation: cdl_3whitesoldiers (bullish), cdl_3blackcrows (bearish)\n- Indecision: cdl_doji, cdl_spinningtop\n\n**Parabolic SAR** (`sar`):\n- SAR below price = uptrend. SAR above price = downtrend.\n- SAR flips = potential trend reversal.\n\n### Signal Combination Framework\nStrong signals combine multiple confirming indicators:\n- **Strong bullish**: RSI rising from <30 + MACD crossover + price > SMA-200\n  + volume > 1.5x average + bullish candlestick pattern\n- **Strong bearish**: RSI falling from >70 + MACD bearish cross + price < SMA-200\n  + increasing volume + bearish pattern\n- **Caution**: ADX < 20 (weak trend) makes all signals less reliable\n- **Divergence**: Price makes new high but RSI/MACD doesn't = weakening\n\n### Workflow\n1. **Trend**: Where is price relative to SMA-200, EMA-50, EMA-20?\n2. **Momentum**: RSI, MACD histogram, stochastic readings\n3. **Strength**: ADX reading + directional indicators\n4. **Volatility**: Bollinger Band position, ATR level\n5. **Volume**: Is volume confirming the move?\n6. **Patterns**: Any candlestick signals on recent dates?\n7. **Synthesis**: Combine into overall signal with confidence level\n\n### Output Format\n- **Trend Summary**: Bullish/Bearish/Neutral with timeframe context\n- **Key Signals** (inline table: indicator, value, interpretation)\n- **Confluences**: Which signals agree? Which disagree?\n- **Risk Levels**: What would invalidate the current thesis?\n- **Caveat**: Technical indicators are backward-looking and do not\n  predict future price movement.\n\n### Advanced Query Patterns\n\n#### T1: Full technical dashboard (single symbol)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.open, sq.high, sq.low, sq.close, sq.volume,\n    ti.*,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ' AND sq.date >= CURRENT_DATE - INTERVAL '7 days'\n)\nSELECT date, close, volume,\n  -- Trend\n  ROUND(sma_200, 2) AS sma_200, ROUND(ema_50, 2) AS ema_50, ROUND(ema_20, 2) AS ema_20,\n  CASE WHEN close > sma_200 THEN 'Above' ELSE 'Below' END AS vs_sma200,\n  -- Momentum\n  ROUND(rsi_14, 1) AS rsi,\n  ROUND(macd, 4) AS macd, ROUND(macdsignal, 4) AS signal, ROUND(macdhist, 4) AS hist,\n  ROUND(stoch_k, 1) AS stoch_k, ROUND(stoch_d, 1) AS stoch_d,\n  -- Strength\n  ROUND(adx_14, 1) AS adx,\n  CASE WHEN plus_di_14 > minus_di_14 THEN 'Bullish' ELSE 'Bearish' END AS di_signal,\n  -- Volatility\n  ROUND(bb_upper, 2) AS bb_up, ROUND(bb_lower, 2) AS bb_low, ROUND(atr_14, 2) AS atr,\n  -- Volume\n  ROUND(volume / NULLIF(volume_ma_20, 0), 2) AS vol_ratio,\n  ROUND(mfi_14, 1) AS mfi,\n  -- SAR\n  ROUND(sar, 2) AS sar,\n  CASE WHEN close > sar THEN 'Uptrend' ELSE 'Downtrend' END AS sar_signal\nFROM latest WHERE rn = 1\nLIMIT 1\n```\n\n#### T2: RSI divergence detection (price up, RSI down over N days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close, ti.rsi_14,\n    FIRST_VALUE(sq.close) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_price,\n    FIRST_VALUE(ti.rsi_14) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_rsi,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '30 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT symbol, date, close, ROUND(rsi_14, 1) AS rsi,\n  ROUND(start_price, 2) AS start_price, ROUND(start_rsi, 1) AS start_rsi,\n  CASE\n    WHEN close > start_price AND rsi_14 < start_rsi THEN 'Bearish divergence'\n    WHEN close < start_price AND rsi_14 > start_rsi THEN 'Bullish divergence'\n    ELSE 'No divergence'\n  END AS divergence_signal\nFROM data\nWHERE rn = 1\n  AND symbol IN ('AAPL.NASDAQ', 'MSFT.NASDAQ', 'GOOGL.NASDAQ')\nLIMIT 20\n```\n\n#### T3: Multi-symbol technical screen (oversold + trend + volume)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.close, sq.volume,\n    ti.rsi_14, ti.sma_200, ti.ema_50, ti.macd, ti.macdsignal,\n    ti.bb_lower, ti.adx_14, ti.volume_ma_20,\n    ti.cdl_hammer, ti.cdl_engulfing, ti.cdl_morningstar,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '7 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT l.symbol, g.name, l.date, l.close,\n  ROUND(l.rsi_14, 1) AS rsi,\n  ROUND(l.close / NULLIF(l.sma_200, 0) * 100 - 100, 1) AS pct_vs_sma200,\n  ROUND(l.adx_14, 1) AS adx,\n  ROUND(l.volume / NULLIF(l.volume_ma_20, 0), 2) AS vol_ratio,\n  CASE WHEN l.cdl_hammer = 100 OR l.cdl_engulfing = 100\n       OR l.cdl_morningstar = 100 THEN 'Bullish pattern' ELSE 'None' END AS pattern\nFROM latest l\nINNER JOIN shibui.general_info g ON l.symbol = g.symbol\nWHERE l.rn = 1\n  AND l.rsi_14 < 30\n  AND l.close < l.bb_lower\n  AND g.type = 'Common Stock'\nORDER BY l.rsi_14 ASC LIMIT 20\n```\n\n#### T4: Trend change detection (SMA crossovers, last 30 days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close,\n    ti.ema_50, ti.sma_200,\n    LAG(ti.ema_50) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_ema50,\n    LAG(ti.sma_200) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_sma200\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ'\n    AND sq.date >= CURRENT_DATE - INTERVAL '60 days'\n    AND ti.ema_50 IS NOT NULL AND ti.sma_200 IS NOT NULL\n)\nSELECT date, ROUND(close, 2) AS close,\n  ROUND(ema_50, 2) AS ema_50, ROUND(sma_200, 2) AS sma_200,\n  CASE\n    WHEN ema_50 > sma_200 AND prev_ema50 <= prev_sma200 THEN 'Golden Cross'\n    WHEN ema_50 < sma_200 AND prev_ema50 >= prev_sma200 THEN 'Death Cross'\n    ELSE NULL\n  END AS crossover\nFROM data\nWHERE (ema_50 > sma_200 AND prev_ema50 <= prev_sma200)\n   OR (ema_50 < sma_200 AND prev_ema50 >= prev_sma200)\nORDER BY date DESC LIMIT 10\n```\n"New value: +"## Technical Analysis Workflow\n\n### Persona\nYou are a technical analyst specializing in momentum and trend-\nfollowing strategies. You interpret indicator combinations, not\nsingle signals. You always note the limitations of backward-\nlooking indicators and never claim predictive certainty.\n\n### Indicator Interpretation Guide\n\n**Trend indicators** (direction of the trend):\n- `sma_200` / `ema_200`: Long-term trend. Price above = bullish. Below = bearish.\n- `sma_50` / `ema_50`: Intermediate trend.\n- `sma_20`: Short-term positional view.\n- `ema_9` / `ema_21`: Short-term active-trading view.\n- Golden cross: ema_50 crosses above sma_200. Death cross: below.\n- **Stage 2 (Weinstein)**: Price above rising SMA-200. Identify: `close > sma_200` AND SMA-200 trending up (compare to prior day via LAG).\n\n**Momentum indicators** (strength and speed):\n- `rsi_14`: >70 overbought, <30 oversold, 40-60 neutral.\n  Divergence (price up, RSI down) = weakening momentum.\n- `macd` / `macdsignal` / `macdhist`: MACD > signal = bullish.\n  Histogram expanding = momentum increasing. Contracting = fading.\n- `stoch_k` / `stoch_d`: >80 overbought, <20 oversold.\n- `cci_20`: >100 overbought, <-100 oversold.\n- `willr_14`: >-20 overbought, <-80 oversold.\n\n**Trend strength:**\n- `adx_14`: >25 strong trend, <20 weak/no trend.\n  Direction: `plus_di_14` > `minus_di_14` = uptrend.\n\n**Volatility:**\n- `bb_upper` / `bb_middle` / `bb_lower`: Bollinger Bands.\n  Price near upper = overbought, near lower = oversold.\n  Squeeze (bands narrow) = breakout imminent.\n- `atr_14`: Absolute volatility. Use for position sizing context.\n\n**Volume confirmation:**\n- `volume_ma_20`: Compare daily volume to 20-day average.\n  Breakout on >2x average volume = stronger signal.\n- `obv`: Rising OBV with rising price confirms trend.\n  Rising OBV with flat price = accumulation.\n- `mfi_14`: Money Flow Index. >80 overbought, <20 oversold.\n- `cmf_20`: Chaikin Money Flow. >0 = buying pressure, <0 = selling pressure.\n  Sustained readings above/below zero confirm the trend.\n\n**Candlestick patterns** (values: 100=bullish, -100=bearish, 0=none):\n- Reversal: cdl_hammer (bullish), cdl_shootingstar (bearish),\n  cdl_engulfing, cdl_morningstar (bullish), cdl_eveningstar (bearish)\n- Continuation: cdl_3whitesoldiers (bullish), cdl_3blackcrows (bearish)\n- Indecision: cdl_doji, cdl_spinningtop\n\n**Parabolic SAR** (`sar`):\n- SAR below price = uptrend. SAR above price = downtrend.\n- SAR flips = potential trend reversal.\n\n### Signal Combination Framework\nStrong signals combine multiple confirming indicators:\n- **Strong bullish**: RSI rising from <30 + MACD crossover + price > SMA-200\n  + volume > 1.5x average + bullish candlestick pattern\n- **Strong bearish**: RSI falling from >70 + MACD bearish cross + price < SMA-200\n  + increasing volume + bearish pattern\n- **Caution**: ADX < 20 (weak trend) makes all signals less reliable\n- **Divergence**: Price makes new high but RSI/MACD doesn't = weakening\n\n### Workflow\n1. **Trend**: Where is price relative to SMA-200, SMA-50, EMA-50, EMA-21?\n2. **Momentum**: RSI, MACD histogram, stochastic readings\n3. **Strength**: ADX reading + directional indicators\n4. **Volatility**: Bollinger Band position, ATR level\n5. **Volume**: Is volume confirming the move?\n6. **Patterns**: Any candlestick signals on recent dates?\n7. **Synthesis**: Combine into overall signal with confidence level\n\n### Output Format\n- **Trend Summary**: Bullish/Bearish/Neutral with timeframe context\n- **Key Signals** (inline table: indicator, value, interpretation)\n- **Confluences**: Which signals agree? Which disagree?\n- **Risk Levels**: What would invalidate the current thesis?\n- **Caveat**: Technical indicators are backward-looking and do not\n  predict future price movement.\n\n### Advanced Query Patterns\n\n#### T1: Full technical dashboard (single symbol)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.open, sq.high, sq.low, sq.close, sq.volume,\n    ti.*,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ' AND sq.date >= CURRENT_DATE - INTERVAL '7 days'\n)\nSELECT date, close, volume,\n  -- Trend\n  ROUND(sma_200, 2) AS sma_200, ROUND(sma_50, 2) AS sma_50,\n  ROUND(ema_50, 2) AS ema_50, ROUND(ema_21, 2) AS ema_21, ROUND(ema_9, 2) AS ema_9,\n  CASE WHEN close > sma_200 THEN 'Above' ELSE 'Below' END AS vs_sma200,\n  -- Momentum\n  ROUND(rsi_14, 1) AS rsi,\n  ROUND(macd, 4) AS macd, ROUND(macdsignal, 4) AS signal, ROUND(macdhist, 4) AS hist,\n  ROUND(stoch_k, 1) AS stoch_k, ROUND(stoch_d, 1) AS stoch_d,\n  -- Strength\n  ROUND(adx_14, 1) AS adx,\n  CASE WHEN plus_di_14 > minus_di_14 THEN 'Bullish' ELSE 'Bearish' END AS di_signal,\n  -- Volatility\n  ROUND(bb_upper, 2) AS bb_up, ROUND(bb_lower, 2) AS bb_low, ROUND(atr_14, 2) AS atr,\n  -- Volume\n  ROUND(volume / NULLIF(volume_ma_20, 0), 2) AS vol_ratio,\n  ROUND(mfi_14, 1) AS mfi, ROUND(cmf_20, 3) AS cmf,\n  -- SAR\n  ROUND(sar, 2) AS sar,\n  CASE WHEN close > sar THEN 'Uptrend' ELSE 'Downtrend' END AS sar_signal\nFROM latest WHERE rn = 1\nLIMIT 1\n```\n\n#### T2: RSI divergence detection (price up, RSI down over N days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close, ti.rsi_14,\n    FIRST_VALUE(sq.close) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_price,\n    FIRST_VALUE(ti.rsi_14) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_rsi,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '30 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT symbol, date, close, ROUND(rsi_14, 1) AS rsi,\n  ROUND(start_price, 2) AS start_price, ROUND(start_rsi, 1) AS start_rsi,\n  CASE\n    WHEN close > start_price AND rsi_14 < start_rsi THEN 'Bearish divergence'\n    WHEN close < start_price AND rsi_14 > start_rsi THEN 'Bullish divergence'\n    ELSE 'No divergence'\n  END AS divergence_signal\nFROM data\nWHERE rn = 1\n  AND symbol IN ('AAPL.NASDAQ', 'MSFT.NASDAQ', 'GOOGL.NASDAQ')\nLIMIT 20\n```\n\n#### T3: Multi-symbol technical screen (oversold + trend + volume)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.close, sq.volume,\n    ti.rsi_14, ti.sma_200, ti.sma_50, ti.ema_50, ti.macd, ti.macdsignal,\n    ti.bb_lower, ti.adx_14, ti.volume_ma_20,\n    ti.cdl_hammer, ti.cdl_engulfing, ti.cdl_morningstar,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '7 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT l.symbol, g.name, l.date, l.close,\n  ROUND(l.rsi_14, 1) AS rsi,\n  ROUND(l.close / NULLIF(l.sma_200, 0) * 100 - 100, 1) AS pct_vs_sma200,\n  ROUND(l.adx_14, 1) AS adx,\n  ROUND(l.volume / NULLIF(l.volume_ma_20, 0), 2) AS vol_ratio,\n  CASE WHEN l.cdl_hammer = 100 OR l.cdl_engulfing = 100\n       OR l.cdl_morningstar = 100 THEN 'Bullish pattern' ELSE 'None' END AS pattern\nFROM latest l\nINNER JOIN shibui.general_info g ON l.symbol = g.symbol\nWHERE l.rn = 1\n  AND l.rsi_14 < 30\n  AND l.close < l.bb_lower\n  AND g.type = 'Common Stock'\nORDER BY l.rsi_14 ASC LIMIT 20\n```\n\n#### T4: Trend change detection (SMA crossovers, last 30 days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close,\n    ti.ema_50, ti.sma_200,\n    LAG(ti.ema_50) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_ema50,\n    LAG(ti.sma_200) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_sma200\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ'\n    AND sq.date >= CURRENT_DATE - INTERVAL '60 days'\n    AND ti.ema_50 IS NOT NULL AND ti.sma_200 IS NOT NULL\n)\nSELECT date, ROUND(close, 2) AS close,\n  ROUND(ema_50, 2) AS ema_50, ROUND(sma_200, 2) AS sma_200,\n  CASE\n    WHEN ema_50 > sma_200 AND prev_ema50 <= prev_sma200 THEN 'Golden Cross'\n    WHEN ema_50 < sma_200 AND prev_ema50 >= prev_sma200 THEN 'Death Cross'\n    ELSE NULL\n  END AS crossover\nFROM data\nWHERE (ema_50 > sma_200 AND prev_ema50 <= prev_sma200)\n   OR (ema_50 < sma_200 AND prev_ema50 >= prev_sma200)\nORDER BY date DESC LIMIT 10\n```\n"
  3. Changed1 schema field changed
    • changedInput schema / properties / _content / default
      Previous value: -"## Technical Analysis Workflow\n\n### Persona\nYou are a technical analyst specializing in momentum and trend-\nfollowing strategies. You interpret indicator combinations, not\nsingle signals. You always note the limitations of backward-\nlooking indicators and never claim predictive certainty.\n\n### Indicator Interpretation Guide\n\n**Trend indicators** (direction of the trend):\n- `sma_200`: Long-term trend. Price > SMA-200 = bullish. Below = bearish.\n- `ema_50` / `ema_20`: Medium/short-term trend.\n- Golden cross: ema_50 crosses above sma_200. Death cross: below.\n\n**Momentum indicators** (strength and speed):\n- `rsi_14`: >70 overbought, <30 oversold, 40-60 neutral.\n  Divergence (price up, RSI down) = weakening momentum.\n- `macd` / `macdsignal` / `macdhist`: MACD > signal = bullish.\n  Histogram expanding = momentum increasing. Contracting = fading.\n- `stoch_k` / `stoch_d`: >80 overbought, <20 oversold.\n- `cci_20`: >100 overbought, <-100 oversold.\n- `willr_14`: >-20 overbought, <-80 oversold.\n\n**Trend strength:**\n- `adx_14`: >25 strong trend, <20 weak/no trend.\n  Direction: `plus_di_14` > `minus_di_14` = uptrend.\n\n**Volatility:**\n- `bb_upper` / `bb_middle` / `bb_lower`: Bollinger Bands.\n  Price near upper = overbought, near lower = oversold.\n  Squeeze (bands narrow) = breakout imminent.\n- `atr_14`: Absolute volatility. Use for position sizing context.\n\n**Volume confirmation:**\n- `volume_ma_20`: Compare daily volume to 20-day average.\n  Breakout on >2x average volume = stronger signal.\n- `obv`: Rising OBV with rising price confirms trend.\n  Rising OBV with flat price = accumulation.\n- `mfi_14`: Money Flow Index. >80 overbought, <20 oversold.\n\n**Candlestick patterns** (values: 100=bullish, -100=bearish, 0=none):\n- Reversal: cdl_hammer (bullish), cdl_shootingstar (bearish),\n  cdl_engulfing, cdl_morningstar (bullish), cdl_eveningstar (bearish)\n- Continuation: cdl_3whitesoldiers (bullish), cdl_3blackcrows (bearish)\n- Indecision: cdl_doji, cdl_spinningtop\n\n**Parabolic SAR** (`sar`):\n- SAR below price = uptrend. SAR above price = downtrend.\n- SAR flips = potential trend reversal.\n\n### Signal Combination Framework\nStrong signals combine multiple confirming indicators:\n- **Strong bullish**: RSI rising from <30 + MACD crossover + price > SMA-200\n  + volume > 1.5x average + bullish candlestick pattern\n- **Strong bearish**: RSI falling from >70 + MACD bearish cross + price < SMA-200\n  + increasing volume + bearish pattern\n- **Caution**: ADX < 20 (weak trend) makes all signals less reliable\n- **Divergence**: Price makes new high but RSI/MACD doesn't = weakening\n\n### Workflow\n1. **Trend**: Where is price relative to SMA-200, EMA-50, EMA-20?\n2. **Momentum**: RSI, MACD histogram, stochastic readings\n3. **Strength**: ADX reading + directional indicators\n4. **Volatility**: Bollinger Band position, ATR level\n5. **Volume**: Is volume confirming the move?\n6. **Patterns**: Any candlestick signals on recent dates?\n7. **Synthesis**: Combine into overall signal with confidence level\n\n### Output Format\n- **Trend Summary**: Bullish/Bearish/Neutral with timeframe context\n- **Key Signals** (inline table: indicator, value, interpretation)\n- **Confluences**: Which signals agree? Which disagree?\n- **Risk Levels**: What would invalidate the current thesis?\n- **Caveat**: Technical indicators are backward-looking and do not\n  predict future price movement.\n\n### Advanced Query Patterns\n\n#### T1: Full technical dashboard (single symbol)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.open, sq.high, sq.low, sq.close, sq.volume,\n    ti.*,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ' AND sq.date >= CURRENT_DATE - INTERVAL '7 days'\n)\nSELECT date, close, volume,\n  -- Trend\n  ROUND(sma_200, 2) AS sma_200, ROUND(ema_50, 2) AS ema_50, ROUND(ema_20, 2) AS ema_20,\n  CASE WHEN close > sma_200 THEN 'Above' ELSE 'Below' END AS vs_sma200,\n  -- Momentum\n  ROUND(rsi_14, 1) AS rsi,\n  ROUND(macd, 4) AS macd, ROUND(macdsignal, 4) AS signal, ROUND(macdhist, 4) AS hist,\n  ROUND(stoch_k, 1) AS stoch_k, ROUND(stoch_d, 1) AS stoch_d,\n  -- Strength\n  ROUND(adx_14, 1) AS adx,\n  CASE WHEN plus_di_14 > minus_di_14 THEN 'Bullish' ELSE 'Bearish' END AS di_signal,\n  -- Volatility\n  ROUND(bb_upper, 2) AS bb_up, ROUND(bb_lower, 2) AS bb_low, ROUND(atr_14, 2) AS atr,\n  -- Volume\n  ROUND(volume / NULLIF(volume_ma_20, 0), 2) AS vol_ratio,\n  ROUND(mfi_14, 1) AS mfi,\n  -- SAR\n  ROUND(sar, 2) AS sar,\n  CASE WHEN close > sar THEN 'Uptrend' ELSE 'Downtrend' END AS sar_signal\nFROM latest WHERE rn = 1\nLIMIT 1\n```\n\n#### T2: RSI divergence detection (price up, RSI down over N days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close, ti.rsi_14,\n    FIRST_VALUE(sq.close) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_price,\n    FIRST_VALUE(ti.rsi_14) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_rsi,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '30 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT symbol, date, close, ROUND(rsi_14, 1) AS rsi,\n  ROUND(start_price, 2) AS start_price, ROUND(start_rsi, 1) AS start_rsi,\n  CASE\n    WHEN close > start_price AND rsi_14 < start_rsi THEN 'Bearish divergence'\n    WHEN close < start_price AND rsi_14 > start_rsi THEN 'Bullish divergence'\n    ELSE 'No divergence'\n  END AS divergence_signal\nFROM data\nWHERE rn = 1\n  AND symbol IN ('AAPL.NASDAQ', 'MSFT.NASDAQ', 'GOOGL.NASDAQ')\nLIMIT 20\n```\n\n#### T3: Multi-symbol technical screen (oversold + trend + volume)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.close, sq.volume,\n    ti.rsi_14, ti.sma_200, ti.ema_50, ti.macd, ti.macdsignal,\n    ti.bb_lower, ti.adx_14, ti.volume_ma_20,\n    ti.cdl_hammer, ti.cdl_engulfing, ti.cdl_morningstar,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '7 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT l.symbol, g.name, l.date, l.close,\n  ROUND(l.rsi_14, 1) AS rsi,\n  ROUND(l.close / NULLIF(l.sma_200, 0) * 100 - 100, 1) AS pct_vs_sma200,\n  ROUND(l.adx_14, 1) AS adx,\n  ROUND(l.volume / NULLIF(l.volume_ma_20, 0), 2) AS vol_ratio,\n  CASE WHEN l.cdl_hammer = 100 OR l.cdl_engulfing = 100\n       OR l.cdl_morningstar = 100 THEN 'Bullish pattern' ELSE 'None' END AS pattern\nFROM latest l\nINNER JOIN shibui.general_info g ON l.symbol = g.symbol\nWHERE l.rn = 1\n  AND l.rsi_14 < 30\n  AND l.close < l.bb_lower\n  AND g.type = 'Common Stock'\nORDER BY l.rsi_14 ASC LIMIT 20\n```\n\n#### T4: Trend change detection (SMA crossovers, last 30 days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close,\n    ti.ema_50, ti.sma_200,\n    LAG(ti.ema_50) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_ema50,\n    LAG(ti.sma_200) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_sma200\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ'\n    AND sq.date >= CURRENT_DATE - INTERVAL '60 days'\n    AND ti.ema_50 IS NOT NULL AND ti.sma_200 IS NOT NULL\n)\nSELECT date, ROUND(close, 2) AS close,\n  ROUND(ema_50, 2) AS ema_50, ROUND(sma_200, 2) AS sma_200,\n  CASE\n    WHEN ema_50 > sma_200 AND prev_ema50 <= prev_sma200 THEN 'Golden Cross'\n    WHEN ema_50 < sma_200 AND prev_ema50 >= prev_sma200 THEN 'Death Cross'\n    ELSE NULL\n  END AS crossover\nFROM data\nWHERE (ema_50 > sma_200 AND prev_ema50 <= prev_sma200)\n   OR (ema_50 < sma_200 AND prev_ema50 >= prev_sma200)\nORDER BY date DESC LIMIT 10\n```\n"New value: +"## Technical Analysis Workflow\n\n### Persona\nYou are a technical analyst specializing in momentum and trend-\nfollowing strategies. You interpret indicator combinations, not\nsingle signals. You always note the limitations of backward-\nlooking indicators and never claim predictive certainty.\n\n### Indicator Interpretation Guide\n\n**Trend indicators** (direction of the trend):\n- `sma_200`: Long-term trend. Price > SMA-200 = bullish. Below = bearish.\n- `ema_50` / `ema_20`: Medium/short-term trend.\n- Golden cross: ema_50 crosses above sma_200. Death cross: below.\n- **Stage 2 (Weinstein)**: Price above rising SMA-200. Identify: `close > sma_200` AND SMA-200 trending up (compare to prior day via LAG).\n\n**Momentum indicators** (strength and speed):\n- `rsi_14`: >70 overbought, <30 oversold, 40-60 neutral.\n  Divergence (price up, RSI down) = weakening momentum.\n- `macd` / `macdsignal` / `macdhist`: MACD > signal = bullish.\n  Histogram expanding = momentum increasing. Contracting = fading.\n- `stoch_k` / `stoch_d`: >80 overbought, <20 oversold.\n- `cci_20`: >100 overbought, <-100 oversold.\n- `willr_14`: >-20 overbought, <-80 oversold.\n\n**Trend strength:**\n- `adx_14`: >25 strong trend, <20 weak/no trend.\n  Direction: `plus_di_14` > `minus_di_14` = uptrend.\n\n**Volatility:**\n- `bb_upper` / `bb_middle` / `bb_lower`: Bollinger Bands.\n  Price near upper = overbought, near lower = oversold.\n  Squeeze (bands narrow) = breakout imminent.\n- `atr_14`: Absolute volatility. Use for position sizing context.\n\n**Volume confirmation:**\n- `volume_ma_20`: Compare daily volume to 20-day average.\n  Breakout on >2x average volume = stronger signal.\n- `obv`: Rising OBV with rising price confirms trend.\n  Rising OBV with flat price = accumulation.\n- `mfi_14`: Money Flow Index. >80 overbought, <20 oversold.\n\n**Candlestick patterns** (values: 100=bullish, -100=bearish, 0=none):\n- Reversal: cdl_hammer (bullish), cdl_shootingstar (bearish),\n  cdl_engulfing, cdl_morningstar (bullish), cdl_eveningstar (bearish)\n- Continuation: cdl_3whitesoldiers (bullish), cdl_3blackcrows (bearish)\n- Indecision: cdl_doji, cdl_spinningtop\n\n**Parabolic SAR** (`sar`):\n- SAR below price = uptrend. SAR above price = downtrend.\n- SAR flips = potential trend reversal.\n\n### Signal Combination Framework\nStrong signals combine multiple confirming indicators:\n- **Strong bullish**: RSI rising from <30 + MACD crossover + price > SMA-200\n  + volume > 1.5x average + bullish candlestick pattern\n- **Strong bearish**: RSI falling from >70 + MACD bearish cross + price < SMA-200\n  + increasing volume + bearish pattern\n- **Caution**: ADX < 20 (weak trend) makes all signals less reliable\n- **Divergence**: Price makes new high but RSI/MACD doesn't = weakening\n\n### Workflow\n1. **Trend**: Where is price relative to SMA-200, EMA-50, EMA-20?\n2. **Momentum**: RSI, MACD histogram, stochastic readings\n3. **Strength**: ADX reading + directional indicators\n4. **Volatility**: Bollinger Band position, ATR level\n5. **Volume**: Is volume confirming the move?\n6. **Patterns**: Any candlestick signals on recent dates?\n7. **Synthesis**: Combine into overall signal with confidence level\n\n### Output Format\n- **Trend Summary**: Bullish/Bearish/Neutral with timeframe context\n- **Key Signals** (inline table: indicator, value, interpretation)\n- **Confluences**: Which signals agree? Which disagree?\n- **Risk Levels**: What would invalidate the current thesis?\n- **Caveat**: Technical indicators are backward-looking and do not\n  predict future price movement.\n\n### Advanced Query Patterns\n\n#### T1: Full technical dashboard (single symbol)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.open, sq.high, sq.low, sq.close, sq.volume,\n    ti.*,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ' AND sq.date >= CURRENT_DATE - INTERVAL '7 days'\n)\nSELECT date, close, volume,\n  -- Trend\n  ROUND(sma_200, 2) AS sma_200, ROUND(ema_50, 2) AS ema_50, ROUND(ema_20, 2) AS ema_20,\n  CASE WHEN close > sma_200 THEN 'Above' ELSE 'Below' END AS vs_sma200,\n  -- Momentum\n  ROUND(rsi_14, 1) AS rsi,\n  ROUND(macd, 4) AS macd, ROUND(macdsignal, 4) AS signal, ROUND(macdhist, 4) AS hist,\n  ROUND(stoch_k, 1) AS stoch_k, ROUND(stoch_d, 1) AS stoch_d,\n  -- Strength\n  ROUND(adx_14, 1) AS adx,\n  CASE WHEN plus_di_14 > minus_di_14 THEN 'Bullish' ELSE 'Bearish' END AS di_signal,\n  -- Volatility\n  ROUND(bb_upper, 2) AS bb_up, ROUND(bb_lower, 2) AS bb_low, ROUND(atr_14, 2) AS atr,\n  -- Volume\n  ROUND(volume / NULLIF(volume_ma_20, 0), 2) AS vol_ratio,\n  ROUND(mfi_14, 1) AS mfi,\n  -- SAR\n  ROUND(sar, 2) AS sar,\n  CASE WHEN close > sar THEN 'Uptrend' ELSE 'Downtrend' END AS sar_signal\nFROM latest WHERE rn = 1\nLIMIT 1\n```\n\n#### T2: RSI divergence detection (price up, RSI down over N days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close, ti.rsi_14,\n    FIRST_VALUE(sq.close) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_price,\n    FIRST_VALUE(ti.rsi_14) OVER (PARTITION BY sq.symbol ORDER BY sq.date ASC) AS start_rsi,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '30 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT symbol, date, close, ROUND(rsi_14, 1) AS rsi,\n  ROUND(start_price, 2) AS start_price, ROUND(start_rsi, 1) AS start_rsi,\n  CASE\n    WHEN close > start_price AND rsi_14 < start_rsi THEN 'Bearish divergence'\n    WHEN close < start_price AND rsi_14 > start_rsi THEN 'Bullish divergence'\n    ELSE 'No divergence'\n  END AS divergence_signal\nFROM data\nWHERE rn = 1\n  AND symbol IN ('AAPL.NASDAQ', 'MSFT.NASDAQ', 'GOOGL.NASDAQ')\nLIMIT 20\n```\n\n#### T3: Multi-symbol technical screen (oversold + trend + volume)\n```sql\nWITH latest AS (\n  SELECT sq.symbol, sq.date, sq.close, sq.volume,\n    ti.rsi_14, ti.sma_200, ti.ema_50, ti.macd, ti.macdsignal,\n    ti.bb_lower, ti.adx_14, ti.volume_ma_20,\n    ti.cdl_hammer, ti.cdl_engulfing, ti.cdl_morningstar,\n    ROW_NUMBER() OVER (PARTITION BY sq.symbol ORDER BY sq.date DESC) AS rn\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.date >= CURRENT_DATE - INTERVAL '7 days'\n    AND ti.rsi_14 IS NOT NULL\n)\nSELECT l.symbol, g.name, l.date, l.close,\n  ROUND(l.rsi_14, 1) AS rsi,\n  ROUND(l.close / NULLIF(l.sma_200, 0) * 100 - 100, 1) AS pct_vs_sma200,\n  ROUND(l.adx_14, 1) AS adx,\n  ROUND(l.volume / NULLIF(l.volume_ma_20, 0), 2) AS vol_ratio,\n  CASE WHEN l.cdl_hammer = 100 OR l.cdl_engulfing = 100\n       OR l.cdl_morningstar = 100 THEN 'Bullish pattern' ELSE 'None' END AS pattern\nFROM latest l\nINNER JOIN shibui.general_info g ON l.symbol = g.symbol\nWHERE l.rn = 1\n  AND l.rsi_14 < 30\n  AND l.close < l.bb_lower\n  AND g.type = 'Common Stock'\nORDER BY l.rsi_14 ASC LIMIT 20\n```\n\n#### T4: Trend change detection (SMA crossovers, last 30 days)\n```sql\nWITH data AS (\n  SELECT sq.symbol, sq.date, sq.close,\n    ti.ema_50, ti.sma_200,\n    LAG(ti.ema_50) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_ema50,\n    LAG(ti.sma_200) OVER (PARTITION BY sq.symbol ORDER BY sq.date) AS prev_sma200\n  FROM shibui.stock_quotes sq\n  INNER JOIN shibui.technical_indicators ti ON sq.symbol = ti.symbol AND sq.date = ti.date\n  WHERE sq.symbol = 'AAPL.NASDAQ'\n    AND sq.date >= CURRENT_DATE - INTERVAL '60 days'\n    AND ti.ema_50 IS NOT NULL AND ti.sma_200 IS NOT NULL\n)\nSELECT date, ROUND(close, 2) AS close,\n  ROUND(ema_50, 2) AS ema_50, ROUND(sma_200, 2) AS sma_200,\n  CASE\n    WHEN ema_50 > sma_200 AND prev_ema50 <= prev_sma200 THEN 'Golden Cross'\n    WHEN ema_50 < sma_200 AND prev_ema50 >= prev_sma200 THEN 'Death Cross'\n    ELSE NULL\n  END AS crossover\nFROM data\nWHERE (ema_50 > sma_200 AND prev_ema50 <= prev_sma200)\n   OR (ema_50 < sma_200 AND prev_ema50 >= prev_sma200)\nORDER BY date DESC LIMIT 10\n```\n"
  4. Changed1 schema field changed
    • addedOutput schema / description
      Added value: +"Generic wrapper for non-object return types."
  5. Added

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent), the description discloses a critical behavioral dependency: the tool must be preceded by two other calls in a specific sequence. It also states it should be called 'BEFORE writing SQL', adding valuable behavioral context not captured by structured metadata.

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?

The description is three sentences, but the second sentence is long with an extensive list of trigger phrases. While not overly verbose, it could be slightly tightened. Still, it front-loads the purpose and prerequisites, with no wasted sentences.

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?

With an output schema present and zero parameters, the description covers all necessary context: purpose, prerequisites, usage timing, and combinability. It leaves no ambiguity about when to invoke this tool versus alternatives.

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?

The tool has zero parameters, and the schema coverage is trivially 100%. With no parameters to document, the description doesn't need to add parameter-level meaning, and the baseline of 4 is appropriate.

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 clearly states 'Load technical workflow' and specifies the exact indicators covered (RSI, MACD, SMA, Bollinger Bands, entry/exit). This distinguishes it from sibling workflow tools like load_fundamental_workflow and load_earnings_workflow by naming technical analysis-specific signals.

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?

It explicitly states the required order of prior calls ('REQUIRES get_database_schema then get_query_patterns to be called first (in that order)') and provides concrete trigger phrases for when to use ('when the user asks about RSI, MACD, moving averages, Bollinger Bands...'). It also notes it can be combined with other workflow tools, offering clear guidance on alternatives.

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.

TDQS

A4.4/5.0
Disambiguation4/5

Most tools have clearly distinct domains (backtesting, comparison, earnings, filings, fundamentals, insider, screening, technical), and descriptions provide specific trigger conditions. However, stock_data_query and export_to_excel are very similar (same query, different output), and some workflow boundaries overlap (e.g., earnings vs. fundamental both mention revenue trends; filing vs. insider both involve SEC documents).

Naming Consistency3/5

All names use snake_case, but the pattern is inconsistent: get_database_schema and get_query_patterns follow verb_noun, the eight load_*_workflow tools follow verb_noun (consistent among themselves), but stock_data_query is a noun phrase with no verb, and export_to_excel includes a preposition. The mixed conventions are still readable but not uniform.

Tool Count4/5

At 12 tools, the count is within the expected 3-15 range and appropriate for the broad scope of comprehensive stock analysis. However, eight of the tools are 'load_*_workflow' entries that are structurally identical, which makes the set feel slightly heavier than necessary, though each covers a distinct analytical domain.

Completeness5/5

The tool set covers the full lifecycle of the domain: schema discovery, query guidance, raw query execution, export in a branded format, and eight specialized workflows covering backtesting, comparisons, earnings, filings, fundamentals, insider trading, screening, and technical analysis. No significant gaps are apparent for the stated purpose of US stock/financial data analysis.

Resources