Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_company_trading_stats

Retrieve trading statistics for Vietnam stock market companies by symbol, providing key market data for analysis and decision-making.

Instructions

Get company trading stats from stock market
Args:
    symbol: str
    output_format: Literal['json', 'dataframe'] = 'json'
Returns:
    pd.DataFrame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
output_formatNojson

Implementation Reference

  • The handler function decorated with @server.tool(), implementing the core logic to fetch company trading stats using vnstock's VCICompany.trading_stats() and format output as JSON or DataFrame.
    @server.tool()
    def get_company_trading_stats(
        symbol: str, output_format: Literal["json", "dataframe"] = "json"
    ):
        """
        Get company trading stats from stock market
        Args:
            symbol: str
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame
        """
        equity = VCICompany(symbol=symbol)
        df = equity.trading_stats()
        if output_format == "json":
            return df.to_json(orient="records", force_ascii=False)
        else:
            return df
  • The @server.tool() decorator registers the get_company_trading_stats function as an MCP tool.
    @server.tool()

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/ariesanhthu/mcp-server-vietnam-stock-trading'

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