Skip to main content
Glama

get_financial_metrics

Extract key financial metrics from the three major financial statements by inputting a stock symbol and specifying the number of recent records to analyze.

Instructions

Get key financial metrics from the three major financial statements.

Input Schema

NameRequiredDescriptionDefault
recent_nNoNumber of most recent records to return
symbolYesStock symbol/ticker (e.g. '000001')

Input Schema (JSON Schema)

{ "properties": { "recent_n": { "anyOf": [ { "minimum": 1, "type": "integer" }, { "type": "null" } ], "default": 10, "description": "Number of most recent records to return", "title": "Recent N" }, "symbol": { "description": "Stock symbol/ticker (e.g. '000001')", "title": "Symbol", "type": "string" } }, "required": [ "symbol" ], "type": "object" }

Implementation Reference

  • The MCP tool 'get_financial_metrics' handler, including schema via Annotated parameters and registration via @mcp.tool decorator. Fetches financial metrics data for a given stock symbol using akshare_one and returns the most recent records as JSON.
    def get_financial_metrics( symbol: Annotated[str, Field(description="Stock symbol/ticker (e.g. '000001')")], recent_n: Annotated[ int | None, Field(description="Number of most recent records to return", ge=1) ] = 10, ) -> str: """ Get key financial metrics from the three major financial statements. """ df = ako.get_financial_metrics(symbol) if recent_n is not None: df = df.head(recent_n) return df.to_json(orient="records") or "[]"

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zwldarren/akshare-one-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server