Skip to main content
Glama

get_news_data

Retrieve stock news data by specifying a stock symbol and the number of recent records to fetch.

Instructions

Get stock-related news data.

Input Schema

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

Implementation Reference

  • The handler function for the 'get_news_data' tool, decorated with @mcp.tool for registration in FastMCP. It fetches stock news data using akshare_one's get_news_data and returns the most recent records as JSON.
    @mcp.tool def get_news_data( 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 stock-related news data.""" df = ako.get_news_data(symbol=symbol, source="eastmoney") if recent_n is not None: df = df.tail(recent_n) return df.to_json(orient="records") or "[]"

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