Compute a custom technical indicator by executing Python code against a SINGLE ticker's OHLCV data. ALWAYS renders a professional multi-pane chart with Bollinger Bands, RSI, and MACD included automatically. ┌──────────────────────────────────────────────────────────────────────┐ │ 🔴 MANDATORY...
Accepts freeform code/query input (code)
Part of the Technical Analysis MCP server. Enforce policies on this tool with Intercept, the open-source MCP proxy.
AI agents invoke indicators_run_custom to trigger processes or run actions in Technical Analysis. Execute operations can have side effects beyond the immediate call -- triggering builds, sending notifications, or starting workflows. Rate limits and argument validation are essential to prevent runaway execution.
indicators_run_custom can trigger processes with real-world consequences. An uncontrolled agent might start dozens of builds, send mass notifications, or kick off expensive compute jobs. Intercept enforces rate limits and validates arguments to keep execution within safe bounds.
Execute tools trigger processes. Rate-limit and validate arguments to prevent unintended side effects.
tools:
indicators_run_custom:
rules:
- action: allow
rate_limit:
max: 10
window: 60
validate:
required_args: true See the full Technical Analysis policy for all 11 tools.
Agents calling execute-class tools like indicators_run_custom have been implicated in these attack patterns. Read the full case and prevention policy for each:
Other tools in the Execute risk category across the catalogue. The same policy patterns (rate-limit, validate) apply to each.
indicators_run_custom is one of the high-risk operations in Technical Analysis. For the full severity-focused view — only the high-risk tools with their recommended policies — see the breakdown for this server, or browse all high-risk tools across every MCP server.
Compute a custom technical indicator by executing Python code against a SINGLE ticker's OHLCV data. ALWAYS renders a professional multi-pane chart with Bollinger Bands, RSI, and MACD included automatically. ┌──────────────────────────────────────────────────────────────────────┐ │ 🔴 MANDATORY — READ BEFORE EVERY CALL │ │ │ │ 1. ALWAYS pass plot_type='overlay' (or 'oscillator' for │ │ oscillator-type indicators like RSI, Stochastic, CCI). │ │ NEVER use 'standalone' — charts are always generated. │ │ │ │ 2. ALWAYS display the chart to the user after the tool returns. │ │ Output this exact markdown in your response: │ │  │ │ The chart_url is in the tool's text output and structured │ │ output. You MUST render it — do NOT just describe the chart. │ │ │ │ 3. Bollinger Bands, RSI(14), and MACD(12,26,9) are ALWAYS │ │ computed and rendered on the chart automatically. Your custom │ │ code only needs to compute the NEW indicator the user asked │ │ for. Do NOT compute BB/RSI/MACD in your code — they're │ │ pre-computed. │ │ │ │ 4. Only omit BB/RSI/MACD if the user EXPLICITLY says "don't │ │ include BB" or "no RSI/MACD". │ └──────────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────┐ │ SANDBOX RULES — READ CAREFULLY BEFORE WRITING CODE │ │ │ │ ✅ AVAILABLE (pre-loaded, use directly — no import needed): │ │ df — DataFrame with: Date, Open, High, Low, Close, Volume │ │ pd — pandas module │ │ np — numpy module │ │ talib — TA-Lib (150+ indicators) │ │ yf — yfinance module │ │ │ │ ❌ FORBIDDEN — will cause immediate error: │ │ • import statements (e.g. import pandas, from math import) │ │ • open() / file I/O (no reading/writing files) │ │ • os / sys / subprocess (no system access) │ │ • requests / urllib (no HTTP calls) │ │ • __import__() (no dynamic imports) │ │ • exec() / eval() (no nested execution) │ │ │ │ ⚠️ WRONG PATTERNS — do NOT do these: │ │ • Looping over multiple tickers in code — use screen_stocks │ │ • import yfinance as yf — yf is ALREADY available │ │ • import numpy as np — np is ALREADY available │ │ • import pandas as pd — pd is ALREADY available │ │ • import talib — talib is ALREADY available │ │ • Creating DataFrames from scratch (df is pre-loaded with data)│ │ │ │ YOUR CODE MUST: add at least one new column to `df`. │ └──────────────────────────────────────────────────────────────────────┘ RECOMMENDED WORKFLOW: 1. Call indicators_list to verify the indicator is not already built-in. 2. If not built-in, research the formula via browser or indicators_web_search. 3. Write Python code that adds new column(s) to `df` using the pre-loaded modules. 4. Call this tool with that code. One ticker per call. FOR MULTI-TICKER SCREENING: Do NOT use this tool to loop over many tickers. Instead: 1. Use market_update_data to load tickers into the screener database. 2. Use market_screen to filter by technical/fundamental criteria. 3. Only use this tool on individual tickers that need indicators NOT in the DB (e.g. SuperTrend, Keltner Channels, custom formulas). EXAMPLES (correct usage): df['KAMA'] = talib.KAMA(df['Close'], timeperiod=30) df['VWAP'] = (df['Volume'] * (df['High']+df['Low']+df['Close'])/3).cumsum() / df['Volume'].cumsum() df['SMA_9'] = talib.SMA(df['Close'], timeperiod=9) df['SuperTrend'] = ... # compute from ATR and price Args: ticker: A REAL stock symbol (e.g. 'AAPL', 'RELIANCE.NS') or crypto. NOT an index name. One ticker per call. code: Python code that adds columns to df. NO import statements. Only df, pd, np, talib, yf are available. indicator_name: Human-readable name (e.g. 'KAMA', 'SuperTrend'). period: Historical data range — '6mo', '1y', or '2y'. interval: '1d' for daily, '1wk' for weekly. plot_type: 'overlay' — plot on top of price chart (DEFAULT, use for most indicators). 'oscillator' — plot in separate pane below (use for RSI-like indicators). 'standalone' — DEPRECATED, still generates full chart. Price data uses a per-day OHLCV cache. Running the same ticker multiple times in a day reuses cached price data (no FMP API call). This means the data is consistent across multiple indicator runs on the same day. Cache refreshes daily at market-specific times (Indian: 8 AM IST, US/Crypto: 7 AM ET). Returns: Preview of the last 20 indicator values, CSV download URL, and chart image (if plot_type is overlay or oscillator). . It is categorised as a Execute tool in the Technical Analysis MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
Add a rule in your Intercept YAML policy under the tools section for indicators_run_custom. You can allow, deny, rate-limit, or validate arguments. Then run Intercept as a proxy in front of the Technical Analysis MCP server.
indicators_run_custom is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the indicators_run_custom rule in your Intercept policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the Intercept policy for indicators_run_custom. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
indicators_run_custom is provided by the Technical Analysis MCP server (ta-mcp/technical-analysis-mcp). Intercept sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Open source. One binary. Zero dependencies.
npx -y @policylayer/intercept