get_income_statements
Retrieve company income statements from Vietnam's stock market to analyze financial performance over quarterly or annual periods.
Instructions
Get income statements of a company from stock market
Args:
symbol: str (symbol of the company to get income statements)
period: Literal['quarter', 'year'] = 'year' (period to get income statements)
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:384-404 (handler)The main handler function for the 'get_income_statements' tool, registered via @server.tool(). It uses VCIFinance to fetch income statement data for a given symbol and period, returning it as JSON or DataFrame.@server.tool() def get_income_statements( symbol: str, period: Literal["quarter", "year"] = "year", output_format: Literal["json", "dataframe"] = "json", ): """ Get income statements of a company from stock market Args: symbol: str (symbol of the company to get income statements) period: Literal['quarter', 'year'] = 'year' (period to get income statements) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ finance = VCIFinance(symbol=symbol, period=period) df = finance.income_statement() if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df
- src/vnstock_mcp/server.py:384-384 (registration)Registration of the get_income_statements tool using the FastMCP @server.tool() decorator.@server.tool()
- src/vnstock_mcp/server.py:386-389 (schema)Input schema defined by function parameters with type hints and Literal constraints.symbol: str, period: Literal["quarter", "year"] = "year", output_format: Literal["json", "dataframe"] = "json", ):