export const FINANCE_TOOLS = [
    {
        "name": "inject_pine_script",
        "description": "Inject a generated OR user-provided Pine Script directly into the TradingView Pine Editor and attempt to add it to the chart. If the user provides the code, use their EXACT code. User MUST have a TradingView tab open.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "script": {
                    "type": "STRING",
                    "description": "The raw Pine Script v5 code to inject (either generated by you or copied verbatim from the user)."
                }
            },
            "required": [
                "script"
            ]
        }
    },
    {
        "name": "fetch_stock_data",
        "description": "Fetch real-time or latest stock/ETF quote, price, volume, 52-week range, market cap. Works for stocks, ETFs, and major indices.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "symbol": {
                    "type": "STRING",
                    "description": "Ticker symbol (e.g. AAPL, SPY, GLD, SLV, GC=F for gold futures)."
                },
                "source": {
                    "type": "STRING",
                    "description": "Optional. Data source preference: yahoo, marketwatch, cnbc. Default auto."
                }
            },
            "required": [
                "symbol"
            ]
        }
    },
    {
        "name": "fetch_metal_prices",
        "description": "Get live spot prices for precious metals: gold (XAU), silver (XAG), platinum (XPT), palladium (XPD), copper (HG). Includes Gold/Silver Ratio.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "metals": {
                    "type": "ARRAY",
                    "items": {
                        "type": "STRING"
                    },
                    "description": "List of metals to fetch: gold, silver, platinum, palladium, copper. Leave empty for all."
                }
            },
            "required": []
        }
    },
    {
        "name": "analyze_chart",
        "description": "Take a screenshot of the current chart and perform deep technical analysis: trend, support/resistance, patterns, momentum indicators, and trade setup.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "asset": {
                    "type": "STRING",
                    "description": "Asset name or ticker being analyzed (helps provide context)."
                },
                "timeframe": {
                    "type": "STRING",
                    "description": "Chart timeframe (e.g. 1m, 5m, 1h, 4h, Daily, Weekly)."
                }
            },
            "required": []
        }
    },
    {
        "name": "scan_sec_filing",
        "description": "Search and read the latest SEC filings for a stock: 10-K, 10-Q, 8-K, 13-F insider filings. Summarize key financial facts, risks, and insider moves.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "symbol": {
                    "type": "STRING",
                    "description": "Stock ticker symbol."
                },
                "filing_type": {
                    "type": "STRING",
                    "description": "Type of filing: 10-K, 10-Q, 8-K, 13-F, or latest."
                }
            },
            "required": [
                "symbol"
            ]
        }
    },
    {
        "name": "risk_calculator",
        "description": "Calculate position size, risk amount, and risk/reward ratio. Essential for trade planning.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "account_size": {
                    "type": "NUMBER",
                    "description": "Total account size in dollars."
                },
                "risk_percent": {
                    "type": "NUMBER",
                    "description": "Risk percentage per trade (e.g. 1 for 1%)."
                },
                "entry_price": {
                    "type": "NUMBER",
                    "description": "Planned entry price."
                },
                "stop_price": {
                    "type": "NUMBER",
                    "description": "Stop loss price."
                },
                "target_price": {
                    "type": "NUMBER",
                    "description": "Take profit target price."
                }
            },
            "required": [
                "account_size",
                "risk_percent",
                "entry_price",
                "stop_price"
            ]
        }
    },
    {
        "name": "economic_calendar",
        "description": "Fetch upcoming high-impact economic events: FOMC meetings, CPI, PPI, NFP, GDP, earnings dates. Critical for knowing what could move the market.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "days_ahead": {
                    "type": "NUMBER",
                    "description": "How many days ahead to look. Default 7."
                },
                "filter": {
                    "type": "STRING",
                    "description": "Filter: all, high-impact, earnings, fed."
                }
            },
            "required": []
        }
    },
    {
        "name": "ticker_sentiment",
        "description": "Scrape and analyze news, Reddit (r/wallstreetbets, r/investing, r/stocks), and analyst ratings for a ticker. Give a bull/bear sentiment score.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "symbol": {
                    "type": "STRING",
                    "description": "Ticker symbol to analyze sentiment for."
                }
            },
            "required": [
                "symbol"
            ]
        }
    },
    {
        "name": "fetch_futures_levels",
        "description": "Get current price and key technical levels for major futures contracts: ES (S&P), NQ (Nasdaq), YM (Dow), RTY (Russell), CL (crude oil), GC (gold), SI (silver), NG (nat gas).",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "contracts": {
                    "type": "ARRAY",
                    "items": {
                        "type": "STRING"
                    },
                    "description": "List of futures symbols (e.g. ES, NQ, GC, CL). Leave empty for all majors."
                }
            },
            "required": []
        }
    },
    {
        "name": "monitor_price_alert",
        "description": "Set a background price alert for any stock, ETF, futures, or metal. Notifies the user when the price crosses a threshold.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "symbol": {
                    "type": "STRING",
                    "description": "Ticker or asset to monitor."
                },
                "condition": {
                    "type": "STRING",
                    "description": "Condition: above or below."
                },
                "price": {
                    "type": "NUMBER",
                    "description": "Price threshold to trigger alert."
                }
            },
            "required": [
                "symbol",
                "condition",
                "price"
            ]
        }
    },
    {
        "name": "read_options_chain",
        "description": "Read and analyze the options chain on the current broker/options page. Identify unusual activity, max pain, high open interest strikes, and notable flows.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "symbol": {
                    "type": "STRING",
                    "description": "Ticker symbol."
                },
                "expiry": {
                    "type": "STRING",
                    "description": "Expiration date filter (e.g. this week, monthly, LEAPS)."
                }
            },
            "required": []
        }
    },
    {
        "name": "dxy_correlation",
        "description": "Fetch the current US Dollar Index (DXY) level and explain its correlation to the assets the user is watching — critical for metals, forex, and commodities.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "assets": {
                    "type": "ARRAY",
                    "items": {
                        "type": "STRING"
                    },
                    "description": "Assets to correlate against DXY (e.g. gold, EUR/USD, crude oil)."
                }
            },
            "required": []
        }
    },
    {
        "name": "sector_rotation",
        "description": "Analyze which market sectors are currently leading and lagging. Shows money flow between sectors (tech, energy, financials, materials, utilities, etc.).",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "period": {
                    "type": "STRING",
                    "description": "Time period: today, 1w, 1m, 3m."
                }
            },
            "required": []
        }
    },
    {
        "name": "ai_portfolio_analysis",
        "description": "Returns a highly stylized, visual portfolio risk assessment HTML widget based on user holdings. Must only be used when analyzing user portfolios or financial screenshot data.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "estimated_value_usd": {
                    "type": "NUMBER",
                    "description": "Total estimated portfolio valuation in USD."
                },
                "pnl_percent": {
                    "type": "NUMBER",
                    "description": "Total open PnL percentage (e.g. -24.78). Negative numbers should be used for losses."
                },
                "risk_rating": {
                    "type": "STRING",
                    "description": "Short rating string: e.g. 'High / Aggressive', 'Balanced', 'Conservative'."
                },
                "conservative_percent": {
                    "type": "NUMBER",
                    "description": "0-100 percentage of portfolio in stable/conservative assets (cash, blue chips, yield)."
                },
                "moderate_percent": {
                    "type": "NUMBER",
                    "description": "0-100 percentage of portfolio in moderate growth assets."
                },
                "aggressive_percent": {
                    "type": "NUMBER",
                    "description": "0-100 percentage of portfolio in high-beta/aggressive speculative assets."
                },
                "restructure_advice": {
                    "type": "STRING",
                    "description": "A 2-3 sentence financial analyst verdict on how to structure the portfolio going forward based on their actual holding mix."
                }
            },
            "required": [
                "estimated_value_usd",
                "pnl_percent",
                "risk_rating",
                "aggressive_percent",
                "restructure_advice"
            ]
        }
    }
];
