get_price_board
Retrieve real-time price board data for Vietnam stock market symbols in JSON or dataframe format to monitor current market values.
Instructions
Get price board from stock market
Args:
symbols: list[str] (list of symbols to get price board)
output_format: Literal['json', 'dataframe'] = 'json'
Returns:
pd.DataFrame
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbols | Yes | ||
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:753-770 (handler)The main handler function for the 'get_price_board' tool, decorated with @server.tool() for MCP registration. It uses VCITrading from vnstock to fetch the price board data for given symbols and returns it as JSON or DataFrame.@server.tool() def get_price_board( symbols: list[str], output_format: Literal["json", "dataframe"] = "json" ): """ Get price board from stock market Args: symbols: list[str] (list of symbols to get price board) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ trading = VCITrading() df = trading.price_board(symbols_list=symbols) if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df
- src/vnstock_mcp/server.py:753-753 (registration)The @server.tool() decorator registers the get_price_board function as an MCP tool.@server.tool()
- src/vnstock_mcp/server.py:754-770 (schema)Input schema defined by function parameters with type hints: symbols (list[str]), output_format (Literal["json", "dataframe"]). Output is pd.DataFrame or JSON string. Docstring provides description.def get_price_board( symbols: list[str], output_format: Literal["json", "dataframe"] = "json" ): """ Get price board from stock market Args: symbols: list[str] (list of symbols to get price board) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ trading = VCITrading() df = trading.price_board(symbols_list=symbols) if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df