Skip to main content
Glama
24mlight

A Share MCP

get_balance_data

Retrieve quarterly balance sheet data for A-share stocks to analyze financial position and track performance over time.

Instructions

Quarterly balance sheet data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
yearYes
quarterYes
limitNo
formatNomarkdown

Implementation Reference

  • MCP tool handler: thin wrapper that invokes the fetch_balance_data use case with shared error handling and logging.
    @app.tool()
    def get_balance_data(code: str, year: str, quarter: int, limit: int = 250, format: str = "markdown") -> str:
        """Quarterly balance sheet data."""
        return run_tool_with_handling(
            lambda: fetch_balance_data(active_data_source, code=code, year=year, quarter=quarter, limit=limit, format=format),
            context=f"get_balance_data:{code}:{year}Q{quarter}",
        )
  • mcp_server.py:52-52 (registration)
    Registration call that defines and registers the get_balance_data tool along with other financial report tools.
    register_financial_report_tools(app, active_data_source)
  • Use case layer: validates inputs, fetches raw data from FinancialDataSource.get_balance_data, and formats as markdown or other.
    def fetch_balance_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_balance_data(code=code, year=year, quarter=quarter)
        return _format_financial_df(df, code=code, year=year, quarter=quarter, dataset="Balance Sheet", format=format, limit=limit)
  • Abstract method definition in the FinancialDataSource interface, specifying input/output types for balance data retrieval.
    @abstractmethod
    def get_balance_data(self, code: str, year: str, quarter: int) -> pd.DataFrame:
        pass
  • Concrete implementation in BaostockDataSource: calls Baostock's query_balance_data API with error handling.
    def get_balance_data(self, code: str, year: str, quarter: int) -> pd.DataFrame:
        """Fetches quarterly balance sheet data (solvency) using Baostock."""
        return _fetch_financial_data(bs.query_balance_data, "Balance Sheet", code, year, quarter)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'Quarterly balance sheet data' but doesn't disclose behavioral traits like whether it's a read-only operation, requires authentication, has rate limits, returns structured data, or handles errors. This leaves significant gaps for a tool with 5 parameters.

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 extremely concise with a single phrase, front-loaded and zero waste. However, this conciseness comes at the cost of under-specification, but based on the dimension's focus on brevity and structure, it scores high.

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?

Given 5 parameters with 0% schema coverage, no annotations, no output schema, and many sibling tools, the description is completely inadequate. It doesn't explain the tool's function, usage, behavior, parameters, or output, leaving the agent with insufficient information to use it 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%, and the description provides no information about parameters. It doesn't explain what 'code', 'year', 'quarter', 'limit', or 'format' mean, their expected values, or how they affect the output, failing to compensate for the lack of schema documentation.

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

Purpose3/5

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

The description 'Quarterly balance sheet data' indicates the resource (balance sheet data) and temporal scope (quarterly), but lacks a specific verb and doesn't distinguish from siblings like get_cash_flow_data or get_profit_data. It's vague about what the tool actually does (e.g., retrieve, analyze, or generate this data).

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. With many sibling tools for financial data (e.g., get_cash_flow_data, get_profit_data), the description offers no context for selection, prerequisites, or exclusions.

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