get_quote_price_depth
Retrieve detailed price depth data for Vietnam stock market symbols, showing bid-ask spreads and order book information to analyze market liquidity and trading opportunities.
Instructions
Get quote price depth from stock market
Args:
symbol: str (symbol to get price depth)
output_format: Literal['json', 'dataframe'] = 'json'
Returns:
pd.DataFrame
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:730-747 (handler)The handler function implements the get_quote_price_depth tool. It uses vnstock.Quote to fetch the price depth data for a given symbol and returns it in JSON or DataFrame format. The @server.tool() decorator registers it with the FastMCP server.@server.tool() def get_quote_price_depth( symbol: str, output_format: Literal["json", "dataframe"] = "json" ): """ Get quote price depth from stock market Args: symbol: str (symbol to get price depth) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ quote = Quote(symbol=symbol, source="VCI") df = quote.price_depth() if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df
- src/vnstock_mcp/server.py:730-730 (registration)The @server.tool() decorator registers the get_quote_price_depth function as an MCP tool in the FastMCP server.@server.tool()
- src/vnstock_mcp/server.py:731-733 (schema)Function signature defines the input schema with type hints for symbol (str) and output_format (Literal["json", "dataframe"]). The docstring provides further description.def get_quote_price_depth( symbol: str, output_format: Literal["json", "dataframe"] = "json" ):