Skip to main content
Glama
24mlight

A Share MCP

get_operation_data

Retrieve quarterly operational capability data for A-share stocks to analyze company performance and make informed investment decisions.

Instructions

Quarterly operation capability data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
yearYes
quarterYes
limitNo
formatNomarkdown

Implementation Reference

  • MCP tool handler for get_operation_data, decorated with @app.tool(). Delegates to use case with error handling and caching.
    @app.tool() def get_operation_data(code: str, year: str, quarter: int, limit: int = 250, format: str = "markdown") -> str: """Quarterly operation capability data.""" return run_tool_with_handling( lambda: fetch_operation_data(active_data_source, code=code, year=year, quarter=quarter, limit=limit, format=format), context=f"get_operation_data:{code}:{year}Q{quarter}", )
  • mcp_server.py:52-52 (registration)
    Registration of financial report tools including get_operation_data by calling the register function.
    register_financial_report_tools(app, active_data_source)
  • Use case helper: validates inputs, fetches raw data from data_source, formats and limits output.
    def fetch_operation_data(data_source: FinancialDataSource, *, code: str, year: str, quarter: int, limit: int, format: str) -> str: validate_year(year) validate_quarter(quarter) validate_output_format(format) df = data_source.get_operation_data(code=code, year=year, quarter=quarter) return _format_financial_df(df, code=code, year=year, quarter=quarter, dataset="Operation Capability", format=format, limit=limit)
  • Core data fetching implementation using Baostock's query_operation_data API.
    def get_operation_data(self, code: str, year: str, quarter: int) -> pd.DataFrame: """Fetches quarterly operation capability data using Baostock.""" return _fetch_financial_data(bs.query_operation_data, "Operation Capability", code, year, quarter)
  • Interface definition specifying the expected signature for data source implementations.
    def get_operation_data(self, code: str, year: str, quarter: int) -> pd.DataFrame: pass

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/24mlight/a_share_mcp_is_just_I_need'

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