Skip to main content
Glama
VaishnaviK23

Trading MCP Server

by VaishnaviK23

trade_history

Retrieve historical trade data for specific stock symbols to analyze past transactions and market activity.

Instructions

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", ...}, ...]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool `trade_history` is defined and implemented here, using `mcp.tool()` to register it. It filters the global `df` (loaded from `TRADE_CSV_PATH`) for a specific stock symbol and returns the records as a list of dictionaries.
    def trade_history(symbol: str) -> list[dict[str, Any]]:
        """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", ...}, ...]
        """
        return df[df['symbol'] == symbol].to_dict(orient='records')

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/VaishnaviK23/Trading-MCP-Server'

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