Skip to main content
Glama
24mlight

A-Share MCP Server

get_cash_flow_data

Retrieve quarterly cash flow data for A-share stocks to analyze financial performance and liquidity metrics.

Instructions

Quarterly cash flow data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
yearYes
quarterYes
limitNo
formatNomarkdown

Implementation Reference

  • The primary MCP tool handler for 'get_cash_flow_data'. It is registered using @app.tool() decorator, performs error handling via run_tool_with_handling, and delegates to the use case fetch_cash_flow_data.
    @app.tool()
    def get_cash_flow_data(code: str, year: str, quarter: int, limit: int = 250, format: str = "markdown") -> str:
        """Quarterly cash flow data."""
        return run_tool_with_handling(
            lambda: fetch_cash_flow_data(active_data_source, code=code, year=year, quarter=quarter, limit=limit, format=format),
            context=f"get_cash_flow_data:{code}:{year}Q{quarter}",
        )
  • Helper use case function that validates inputs (year, quarter, format), fetches raw data from data_source, and formats it into a markdown table.
    def fetch_cash_flow_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_cash_flow_data(code=code, year=year, quarter=quarter)
        return _format_financial_df(df, code=code, year=year, quarter=quarter, dataset="Cash Flow", format=format, limit=limit)
  • Abstract method definition in the data source interface, specifying the input parameters and return type for cash flow data retrieval.
    @abstractmethod
    def get_cash_flow_data(self, code: str, year: str, quarter: int) -> pd.DataFrame:
        pass
  • Concrete implementation of get_cash_flow_data in Baostock data source, delegating to a shared _fetch_financial_data helper that calls the Baostock API.
    def get_cash_flow_data(self, code: str, year: str, quarter: int) -> pd.DataFrame:
        """Fetches quarterly cash flow data using Baostock."""
        return _fetch_financial_data(bs.query_cash_flow_data, "Cash Flow", code, year, quarter)
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. It reveals nothing about behavioral traits: no indication of read/write nature, authentication needs, rate limits, error handling, or output format. The description is purely declarative without operational context.

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

Conciseness4/5

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

The description is extremely concise (two words) and front-loaded with the core concept. However, it's arguably under-specified rather than efficiently concise, as it omits necessary operational details.

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 a financial data tool likely requiring context (e.g., data sources, units, time zones), the description is severely incomplete. It doesn't prepare an agent for effective use.

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%, so the schema provides only titles and types. The description adds no parameter semantics: it doesn't explain what 'code', 'year', 'quarter' represent, what 'limit' controls, or what 'format' options exist. For 5 parameters with zero schema documentation, this is inadequate.

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 cash flow data' states the resource (cash flow data) and temporal scope (quarterly), but lacks a specific verb. It distinguishes from siblings by focusing on cash flow rather than balance sheets or profit data, but doesn't clarify what operation is performed (retrieve, calculate, etc.).

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 like get_balance_data or get_profit_data. The description implies it's for cash flow data, but doesn't specify use cases, prerequisites, or comparisons to sibling tools.

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