Skip to main content
Glama
24mlight

A Share MCP

get_required_reserve_ratio_data

Retrieve required reserve ratio data for analyzing monetary policy and banking regulations in China's A-share market, with customizable date ranges and output formats.

Instructions

Required reserve ratio data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNo
end_dateNo
year_typeNo0
limitNo
formatNomarkdown

Implementation Reference

  • The primary MCP tool handler for 'get_required_reserve_ratio_data'. It defines the tool schema via type hints and docstring, registers it with @app.tool(), and delegates execution to the use case via run_tool_with_handling for shared error handling.
    @app.tool()
    def get_required_reserve_ratio_data(start_date: Optional[str] = None, end_date: Optional[str] = None, year_type: str = '0', limit: int = 250, format: str = "markdown") -> str:
        """Required reserve ratio data."""
        return run_tool_with_handling(
            lambda: fetch_required_reserve_ratio_data(
                active_data_source, start_date=start_date, end_date=end_date, year_type=year_type, limit=limit, format=format
            ),
            context="get_required_reserve_ratio_data",
        )
  • mcp_server.py:55-55 (registration)
    Top-level registration call that invokes the macroeconomic tools registration, including this tool.
    register_macroeconomic_tools(app, active_data_source)
  • Use case helper that performs validation, fetches raw data from the data source interface, adds metadata, and formats the output as markdown table.
    def fetch_required_reserve_ratio_data(data_source: FinancialDataSource, *, start_date: Optional[str], end_date: Optional[str], year_type: str, limit: int, format: str) -> str:
        validate_output_format(format)
        validate_year_type_reserve(year_type)
        df = data_source.get_required_reserve_ratio_data(start_date=start_date, end_date=end_date, year_type=year_type)
        meta = {"dataset": "required_reserve_ratio", "start_date": start_date, "end_date": end_date, "year_type": year_type}
        return format_table_output(df, format=format, max_rows=limit, meta=meta)
  • Concrete data source implementation that calls the Baostock query_required_reserve_ratio_data API through a shared macro data fetcher.
    def get_required_reserve_ratio_data(self, start_date: Optional[str] = None, end_date: Optional[str] = None, year_type: str = '0') -> pd.DataFrame:
        """Fetches required reserve ratio data using Baostock."""
        # Note the extra yearType parameter handled by kwargs
        return _fetch_macro_data(bs.query_required_reserve_ratio_data, "Required Reserve Ratio", start_date, end_date, yearType=year_type)
  • Interface definition providing the contract (schema) for the data method called by the use case.
    @abstractmethod
    def get_required_reserve_ratio_data(self, start_date: Optional[str] = None, end_date: Optional[str] = None, year_type: str = '0') -> pd.DataFrame:
        """Fetches required reserve ratio data."""
        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