Skip to main content
Glama

get_financial_metrics

Retrieve key financial metrics from balance sheets, income statements, and cash flow statements for stock analysis and investment research.

Instructions

Get key financial metrics from the three major financial statements.

Input Schema

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

Implementation Reference

  • The main handler function for the 'get_financial_metrics' tool, registered via @mcp.tool decorator. It fetches financial metrics data using ako.get_financial_metrics(symbol), limits rows if specified, and returns JSON.
    @mcp.tool 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 "[]"
  • Input schema definition using Pydantic Annotated and Field for symbol (required str) and optional recent_n (int >=1).
    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:
  • Tool registration using @mcp.tool decorator on the handler function.
    @mcp.tool

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