Skip to main content
Glama
24mlight

A-Share MCP Server

get_loan_rate_data

Retrieve benchmark loan rate data for financial analysis and market research. Specify date ranges and output formats to access historical lending rates.

Instructions

Benchmark loan rates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNo
end_dateNo
limitNo
formatNomarkdown

Implementation Reference

  • The MCP tool handler for 'get_loan_rate_data'. Decorated with @app.tool(), it wraps the use case execution in run_tool_with_handling for shared validation and error 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)
    Registration of macroeconomic tools, including 'get_loan_rate_data', by calling the register_macroeconomic_tools function on the FastMCP app instance.
    register_macroeconomic_tools(app, active_data_source)
  • Helper use case function that fetches loan rate data from the FinancialDataSource, validates format, and formats the output as markdown table.
    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)
  • Concrete implementation in BaostockDataSource that queries the Baostock API for loan rate data 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)
  • Abstract method definition in FinancialDataSource interface, specifying the expected signature and return type for loan rate data fetching.
    @abstractmethod
    def get_loan_rate_data(self, start_date: Optional[str] = None, end_date: Optional[str] = None) -> pd.DataFrame:
        """Fetches benchmark loan rates."""
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Benchmark loan rates.' reveals nothing about whether this is a read/write operation, authentication requirements, rate limits, data freshness, or what format/scope the data covers. It's completely inadequate for a data retrieval tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is maximally concise at just two words. While severely under-specified, it contains no wasted words and is properly front-loaded with the core purpose. Every word earns its place, though more content would be needed for adequacy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter data retrieval tool with no annotations, 0% schema coverage, and no output schema, the description is completely inadequate. It doesn't explain what 'benchmark loan rates' means, what data is returned, how parameters affect results, or any behavioral characteristics. The agent would struggle to use this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning none of the 4 parameters (start_date, end_date, limit, format) are documented in the schema. The description adds zero information about these parameters - it doesn't mention date ranges, result limits, output formats, or any parameter semantics. This fails to compensate for the complete lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Benchmark loan rates.' is a tautology that essentially restates the tool name 'get_loan_rate_data'. It specifies the resource ('loan rates') but lacks a clear verb beyond the implied 'get' from the name. It doesn't distinguish this tool from sibling tools like 'get_deposit_rate_data' or 'get_balance_data' that also retrieve financial data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of context, prerequisites, or comparison to sibling tools like 'get_deposit_rate_data' for deposit rates or 'get_historical_k_data' for historical stock data. The agent receives no usage direction beyond the tool name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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