Skip to main content
Glama

add_to_watchlist

Add a financial symbol to your monitoring watchlist for real-time tracking and analysis within quantitative finance tools.

Instructions

Adds a symbol to the monitoring watchlist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes

Implementation Reference

  • Core handler function that uppercases the symbol, loads current watchlist, appends if not present, saves to JSON file, logs, and returns confirmation message.
    def add_to_watchlist(symbol: str) -> str: """ Adds a symbol to the monitoring watchlist. """ symbol = symbol.upper() watchlist = _load_watchlist() if symbol not in watchlist: watchlist.append(symbol) _save_watchlist(watchlist) logger.info(f"Added {symbol} to watchlist") return f"Added {symbol} to watchlist." return f"{symbol} is already in the watchlist."
  • Internal helper to load the watchlist from JSON file, handling missing or corrupt files gracefully.
    def _load_watchlist() -> List[str]: if not WATCHLIST_FILE.exists(): return [] try: with open(WATCHLIST_FILE, "r") as f: return json.load(f) except Exception: return []
  • Internal helper to persist the watchlist to JSON file.
    def _save_watchlist(watchlist: List[str]): with open(WATCHLIST_FILE, "w") as f: json.dump(watchlist, f, indent=4)
  • server.py:410-413 (registration)
    MCP tool registration of add_to_watchlist function via register_tools helper.
    register_tools( [add_to_watchlist, remove_from_watchlist], "Watchlist" )

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/N-lia/MonteWalk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server