Skip to main content
Glama
24mlight

A Share MCP

by 24mlight

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 main handler function for the 'get_cash_flow_data' tool, decorated with @app.tool(). It wraps the use case execution with error handling via run_tool_with_handling and provides the tool's docstring and signature defining input/output schema.
    @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}",
        )
  • mcp_server.py:52-52 (registration)
    The call to register_financial_report_tools, which defines and registers the get_cash_flow_data tool among others, passing the MCP app and active data source.
    register_financial_report_tools(app, active_data_source)
  • The use case function fetch_cash_flow_data that performs input validation, fetches raw data from the data source, and formats the output as markdown or other specified format.
    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)
  • The concrete implementation in BaostockDataSource that calls the Baostock API bs.query_cash_flow_data via a shared helper _fetch_financial_data to retrieve the raw DataFrame.
    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)
  • The abstract method definition in the FinancialDataSource interface, defining the expected signature for cash flow data retrieval.
    @abstractmethod
    def get_cash_flow_data(self, code: str, year: str, quarter: int) -> pd.DataFrame:
        pass
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to describe any traits: it doesn't specify if this is a read-only operation, what permissions might be needed, potential rate limits, error conditions, or the format/scope of returned data. For a tool with 5 parameters and no output schema, this lack of transparency is critical.

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, 'Quarterly cash flow data.', which is front-loaded and wastes no words. While it under-specifies the tool's functionality, it earns full marks for brevity and lack of redundancy.

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 the complexity (5 parameters, 0% schema coverage, no annotations, no output schema, and many sibling tools), the description is severely incomplete. It doesn't clarify the tool's purpose, usage, behavior, or parameters, making it insufficient for an agent to understand or correctly invoke this tool in context.

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 5 parameters have descriptions in the schema. The tool description adds no information about parameters like 'code', 'year', 'quarter', 'limit', or 'format', leaving their semantics, valid values, and interactions completely undocumented, which is inadequate for agent invocation.

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 'Quarterly cash flow data' is a tautology that essentially restates the tool name 'get_cash_flow_data' without adding meaningful specificity. It doesn't clarify what 'cash flow data' entails (e.g., financial metrics, statements, or specific fields) or distinguish this tool from siblings like 'get_balance_data' or 'get_profit_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?

No guidance is provided on when to use this tool versus alternatives. With many sibling tools for financial data retrieval (e.g., 'get_balance_data', 'get_profit_data'), the description offers no context, prerequisites, or exclusions to help an agent decide between them, leaving usage ambiguous.

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