Skip to main content
Glama
24mlight

A Share MCP

get_deposit_rate_data

Retrieve benchmark deposit rate data for A-share market analysis. Specify date ranges to access historical rates for financial research and comparison.

Instructions

Benchmark deposit rates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNo
end_dateNo
limitNo
formatNomarkdown

Implementation Reference

  • The primary tool handler for 'get_deposit_rate_data'. It is decorated with @app.tool() which defines the tool schema from its signature and docstring. The handler delegates to the use case function with standardized error handling via run_tool_with_handling.
    @app.tool()
    def get_deposit_rate_data(start_date: Optional[str] = None, end_date: Optional[str] = None, limit: int = 250, format: str = "markdown") -> str:
        """Benchmark deposit rates."""
        return run_tool_with_handling(
            lambda: fetch_deposit_rate_data(active_data_source, start_date=start_date, end_date=end_date, limit=limit, format=format),
            context="get_deposit_rate_data",
        )
  • mcp_server.py:55-55 (registration)
    Registration of the macroeconomic tools module, which includes the 'get_deposit_rate_data' tool, called during app initialization.
    register_macroeconomic_tools(app, active_data_source)
  • Abstract method in FinancialDataSource interface defining the expected signature for fetching deposit rate data, serving as a contract/schema for implementations.
    @abstractmethod
    def get_deposit_rate_data(self, start_date: Optional[str] = None, end_date: Optional[str] = None) -> pd.DataFrame:
        """Fetches benchmark deposit rates."""
  • Helper use case function that orchestrates validation, data fetching from data source, and output formatting for the deposit rate tool.
    def fetch_deposit_rate_data(data_source: FinancialDataSource, *, start_date: Optional[str], end_date: Optional[str], limit: int, format: str) -> str:
        validate_output_format(format)
        df = data_source.get_deposit_rate_data(start_date=start_date, end_date=end_date)
        meta = {"dataset": "deposit_rate", "start_date": start_date, "end_date": end_date}
        return format_table_output(df, format=format, max_rows=limit, meta=meta)
  • Implementation of the data source method using Baostock's query_deposit_rate_data API, wrapped by a generic macro data fetcher.
    def get_deposit_rate_data(self, start_date: Optional[str] = None, end_date: Optional[str] = None) -> pd.DataFrame:
        """Fetches benchmark deposit rates using Baostock."""
        return _fetch_macro_data(bs.query_deposit_rate_data, "Deposit Rate", start_date, end_date)

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