Skip to main content
Glama
24mlight

A Share MCP

get_loan_rate_data

Retrieve benchmark loan rate data for A-share market analysis. Specify date ranges and formats to access historical lending rate information.

Instructions

Benchmark loan rates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNo
end_dateNo
limitNo
formatNomarkdown

Implementation Reference

  • The primary MCP tool handler for 'get_loan_rate_data'. It is decorated with @app.tool() for automatic registration and delegates execution to the use case layer with standardized error handling via run_tool_with_handling.
    @app.tool()
    def get_loan_rate_data(start_date: Optional[str] = None, end_date: Optional[str] = None, limit: int = 250, format: str = "markdown") -> str:
        """Benchmark loan rates."""
        return run_tool_with_handling(
            lambda: fetch_loan_rate_data(active_data_source, start_date=start_date, end_date=end_date, limit=limit, format=format),
            context="get_loan_rate_data",
        )
  • mcp_server.py:55-55 (registration)
    The call to register_macroeconomic_tools which defines and registers the macroeconomic tools, including get_loan_rate_data, to the FastMCP app instance.
    register_macroeconomic_tools(app, active_data_source)
  • Use case helper that fetches loan rate data from the data source, applies validation and formatting, and returns formatted output.
    def fetch_loan_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_loan_rate_data(start_date=start_date, end_date=end_date)
        meta = {"dataset": "loan_rate", "start_date": start_date, "end_date": end_date}
        return format_table_output(df, format=format, max_rows=limit, meta=meta)
  • Abstract method in FinancialDataSource interface defining the expected signature for loan rate data retrieval.
    def get_loan_rate_data(self, start_date: Optional[str] = None, end_date: Optional[str] = None) -> pd.DataFrame:
        """Fetches benchmark loan rates."""
  • Concrete implementation in BaostockDataSource that fetches loan rate data via Baostock API using the shared _fetch_macro_data helper.
    def get_loan_rate_data(self, start_date: Optional[str] = None, end_date: Optional[str] = None) -> pd.DataFrame:
        """Fetches benchmark loan rates using Baostock."""
        return _fetch_macro_data(bs.query_loan_rate_data, "Loan 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