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')
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It adequately discloses the return format (list of dicts with example fields like 'date' and 'type'), but fails to mention safety characteristics (read-only status), authentication requirements, time range limitations, or pagination behavior for large histories.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The docstring-style structure (Args/Returns/Example) is logically organized and front-loaded with the core purpose. The content is efficient with no redundant sentences, though the explicit 'Args:' and 'Returns:' headers add slight verbosity that could be condensed in an MCP-specific format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the single simple parameter and existence of an output schema, the description provides appropriate additional context. It compensates for the schema's lack of parameter descriptions and supplements the output schema with a concrete example showing data structure (e.g., 'type': 'Buy'), leaving minimal gaps for a read-only data retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage (only 'title': 'Symbol'), so the description fully compensates by explaining that the parameter is a 'stock ticker symbol' and provides concrete examples (AMZN, MSFT). It could be improved by noting format constraints (e.g., uppercase), but the examples provide sufficient semantic context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Return') and resource ('trade history') with scope ('for a specific stock symbol'). It effectively distinguishes from siblings like current_price (current market data) versus historical records, and portfolio (current holdings) versus transaction history.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage through the return value specification ('list of dictionaries containing all trade records'), suggesting it should be used when historical transaction data is needed. However, it lacks explicit guidance on when to prefer this over simulate_sell, validate_trades, or portfolio, and does not mention any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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