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.DataFrameInput Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:239-256 (handler)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 - src/vnstock_mcp/server.py:239-239 (registration)The @server.tool() decorator registers the get_company_trading_stats function as an MCP tool.
@server.tool()