get_cash_flows
Retrieve cash flow statements for Vietnamese companies to analyze financial performance over quarterly or annual periods.
Instructions
Get cash flows of a company from stock market
Args:
symbol: str (symbol of the company to get cash flows)
period: Literal['quarter', 'year'] = 'year' (period to get cash flows)
output_format: Literal['json', 'dataframe'] = 'json'
Returns:
pd.DataFrame
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| period | No | year | |
| output_format | No | json |
Implementation Reference
- src/vnstock_mcp/server.py:430-448 (handler)The handler function implementing the get_cash_flows tool. It is registered via the @server.tool() decorator. Fetches cash flow statements using vnstock's VCIFinance class and returns the raw DataFrame (note: does not handle 'json' output_format). The type hints define the input schema.@server.tool() def get_cash_flows( symbol: str, period: Literal["quarter", "year"] = "year", output_format: Literal["json", "dataframe"] = "json", ): # pyright: ignore[reportUndefinedVariable] """ Get cash flows of a company from stock market Args: symbol: str (symbol of the company to get cash flows) period: Literal['quarter', 'year'] = 'year' (period to get cash flows) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ finance = VCIFinance(symbol=symbol, period=period) df = finance.cash_flow() return df