get_company_events
Retrieve corporate events for Vietnam-listed companies using stock symbols, with pagination and output format options.
Instructions
Get company events from stock market
Args:
symbol: str
page_size: int = 10
page: int = 0
output_format: Literal['json', 'dataframe'] = 'json'
Returns:
pd.DataFrameInput Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| page_size | No | ||
| page | No | ||
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:68-90 (handler)The handler function for the 'get_company_events' tool. It is registered via the @server.tool() decorator, with input schema defined by type hints and docstring. Executes by fetching events from TCBSCompany.events() and returns as JSON or DataFrame.
@server.tool() def get_company_events( symbol: str, page_size: int = 10, page: int = 0, output_format: Literal["json", "dataframe"] = "json", ): """ Get company events from stock market Args: symbol: str page_size: int = 10 page: int = 0 output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ equity = TCBSCompany(symbol=symbol) df = equity.events(page_size=page_size, page=page) if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df