Skip to main content
Glama
VaishnaviK23

Trading MCP Server

by VaishnaviK23

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
portfolioA

Show current portfolio holdings.

This tool calculates the net number of shares held for each stock symbol by summing all buy and sell trades in the trade history CSV.

Returns: A dictionary mapping stock symbols to their current number of held shares. Only symbols with a positive balance are included.

Example: portfolio() -> {"AAPL": 120, "GOOG": 60}

realized_gainsA

Calculate total realized gains using FIFO method.

This tool goes through the trade history and tracks all buy transactions in a FIFO queue. For each sell, it matches shares with the earliest buys and calculates the realized profit or loss accordingly.

Returns: A float representing the total realized gain or loss (in dollars), rounded to two decimal places.

Example: realized_gains() -> 352.75

unrealized_gainsA

Calculate unrealized gains for current holdings.

This tool calculates unrealized profit or loss by comparing the average buy price for currently held shares against the current market price fetched live using yfinance.

Returns: A dictionary mapping each stock symbol to its unrealized gain or loss in dollars.

Example: unrealized_gains() -> {"AAPL": 125.50, "GOOG": -22.15}

current_priceA

Fetch the live price of a stock symbol.

Args: symbol: Stock ticker symbol (e.g. AAPL, TSLA) - This should be a valid symbol supported by Yahoo Finance.

Returns: The current market price as a float, or -1.0 if the price could not be fetched.

Example: get_live_price("AAPL") -> 193.45

validate_tradesA

Validate that no trades sell more shares than have been bought.

Parses the trade history sequentially to ensure all sell transactions occur only after a corresponding quantity of shares has been bought.

Returns: A list of error messages for invalid trades, if any.

Example: validate_trades() -> ["Invalid sell on 2024-02-10: 20 shares of AAPL (owned: 10)"]

pnlA

Generate a Profit & Loss (P&L) summary.

Combines realized and unrealized gains into a single financial overview.

Returns: A dictionary with keys 'realized' and 'unrealized' representing the total gains.

Example: pnl() -> {"realized": 320.75, "unrealized": 145.60}

trade_historyA

Return the trade history for a specific stock symbol.

Args: symbol: The stock ticker symbol (e.g., AMZN, MSFT)

Returns: A list of dictionaries containing all trade records for that symbol.

Example: trade_history("GOOG") -> [{"date": "2024-01-01", "type": "Buy", ...}, ...]

simulate_sellA

Simulate selling a number of shares of a stock and estimate the profit or loss.

Args: symbol: The stock ticker symbol to simulate the sale for (e.g., TSLA) shares: The number of shares to simulate selling.

Returns: The estimated profit/loss from the simulated sale using FIFO matching, in dollars.

Example: simulate_sell("AAPL", 50) -> 123.45

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.1/5.0

Scored across 8 tools

Disambiguation4/5

Most tools have distinct purposes, but there is some overlap between 'pnl', 'realized_gains', and 'unrealized_gains' that could cause confusion. 'pnl' combines both realized and unrealized gains, while the other two provide separate calculations, which might lead an agent to misselect when seeking specific details.

Naming Consistency3/5

The naming is mixed with snake_case used throughout, but the verb patterns vary: some are nouns (e.g., 'portfolio', 'pnl'), some are verbs (e.g., 'simulate_sell', 'validate_trades'), and some are descriptive phrases (e.g., 'trade_history', 'unrealized_gains'). This inconsistency reduces predictability, though it remains readable.

Tool Count5/5

With 8 tools, the count is well-scoped for a trading server, covering key operations like price fetching, portfolio management, gain calculations, and trade validation. Each tool serves a clear purpose without being overwhelming or insufficient for the domain.

Completeness4/5

The tool set covers core trading functions such as price lookup, portfolio tracking, and gain analysis, but lacks tools for executing trades or managing orders, which are typical in trading systems. This minor gap might require agents to work around, but the existing tools support essential workflows.