get_cash_flow
Retrieve cash flow statement data for companies to analyze financial health and liquidity using stock symbols and customizable time periods.
Instructions
Get company cash flow statement data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Stock symbol/ticker (e.g. '000001') | |
| source | No | Data source | sina |
| recent_n | No | Number of most recent records to return |
Implementation Reference
- src/akshare_one_mcp/server.py:212-224 (handler)The primary handler for the 'get_cash_flow' MCP tool. Includes registration via @mcp.tool decorator, input schema via Annotated Fields (symbol, source='sina', recent_n=10), fetches cash flow data from akshare_one library, limits recent records, and returns JSON string of the DataFrame.@mcp.tool def get_cash_flow( symbol: Annotated[str, Field(description="Stock symbol/ticker (e.g. '000001')")], source: Annotated[Literal["sina"], Field(description="Data source")] = "sina", recent_n: Annotated[ int | None, Field(description="Number of most recent records to return", ge=1) ] = 10, ) -> str: """Get company cash flow statement data.""" df = ako.get_cash_flow(symbol=symbol, source=source) if recent_n is not None: df = df.head(recent_n) return df.to_json(orient="records") or "[]"