Skip to main content
Glama

get_realtime_data

Fetch real-time stock market data for A, B, and H shares using the eastmoney_direct source to monitor current market prices and trading information.

Instructions

Get real-time stock market data. 'eastmoney_direct' support all A,B,H shares

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNoStock symbol/ticker (e.g. '000001')
sourceNoData sourceeastmoney_direct

Implementation Reference

  • The MCP tool handler for get_realtime_data, including registration via @mcp.tool decorator, input schema via Annotated parameters, and the core logic that fetches real-time stock data using akshare_one (ako) library and serializes to JSON.
    @mcp.tool def get_realtime_data( symbol: Annotated[ str | None, Field(description="Stock symbol/ticker (e.g. '000001')") ] = None, source: Annotated[ Literal["xueqiu", "eastmoney", "eastmoney_direct"], Field(description="Data source"), ] = "eastmoney_direct", ) -> str: """Get real-time stock market data. 'eastmoney_direct' support all A,B,H shares""" df = ako.get_realtime_data(symbol=symbol, source=source) return df.to_json(orient="records") or "[]"
  • Input schema definition for the get_realtime_data tool, specifying optional symbol and source parameters with descriptions and allowed values.
    symbol: Annotated[ str | None, Field(description="Stock symbol/ticker (e.g. '000001')") ] = None, source: Annotated[ Literal["xueqiu", "eastmoney", "eastmoney_direct"], Field(description="Data source"), ] = "eastmoney_direct", ) -> str:

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