Skip to main content
Glama
24mlight

A-Share MCP Server

get_profit_data

Retrieve quarterly profitability data for A-share stocks to analyze financial performance by specifying stock code, year, and quarter.

Instructions

Quarterly profitability data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
yearYes
quarterYes
limitNo
formatNomarkdown

Implementation Reference

  • The primary MCP tool handler for 'get_profit_data'. Defines input schema via parameters and docstring, handles execution by delegating to use case with error handling.
    @app.tool()
    def get_profit_data(code: str, year: str, quarter: int, limit: int = 250, format: str = "markdown") -> str:
        """Quarterly profitability data."""
        return run_tool_with_handling(
            lambda: fetch_profit_data(active_data_source, code=code, year=year, quarter=quarter, limit=limit, format=format),
            context=f"get_profit_data:{code}:{year}Q{quarter}",
        )
  • mcp_server.py:52-52 (registration)
    Top-level registration invocation that registers the financial_reports tools module, including get_profit_data.
    register_financial_report_tools(app, active_data_source)
  • Use case helper invoked by the tool handler. Performs input validation, fetches raw data from data source, and formats output as markdown or other.
    def fetch_profit_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_profit_data(code=code, year=year, quarter=quarter)
        return _format_financial_df(df, code=code, year=year, quarter=quarter, dataset="Profitability", format=format, limit=limit)
  • Data source implementation that fetches profitability data using Baostock's query_profit_data API.
    def get_profit_data(self, code: str, year: str, quarter: int) -> pd.DataFrame:
        """Fetches quarterly profitability data using Baostock."""
        return _fetch_financial_data(bs.query_profit_data, "Profitability", 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 the full burden of behavioral disclosure. The description 'Quarterly profitability data' reveals nothing about the tool's behavior—it doesn't indicate whether this is a read operation, what permissions might be needed, whether it's rate-limited, what format the data returns in, or any side effects. It's completely inadequate for a tool with 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—a single phrase with no wasted words. While this brevity contributes to under-specification in other dimensions, from a pure conciseness perspective, it's front-loaded and efficient, earning a high score for this dimension alone.

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 tool's complexity (5 parameters, 3 required), lack of annotations, 0% schema description coverage, and no output schema, the description is completely inadequate. It doesn't explain what the tool does, how to use it, what the parameters mean, or what to expect in return. For a data-fetching tool in a crowded sibling set, this fails to provide the necessary context for an AI agent to use it effectively.

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?

The schema description coverage is 0%, meaning none of the 5 parameters (code, year, quarter, limit, format) are documented in the schema. The description 'Quarterly profitability data' adds no meaning about these parameters—it doesn't explain what 'code' refers to (e.g., stock ticker), what years/quarters are valid, what the limit controls, or what formats are supported. It fails 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.

Purpose2/5

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

The description 'Quarterly profitability data' is a tautology that essentially restates the tool name 'get_profit_data'. It lacks a specific verb indicating what the tool does (e.g., retrieve, fetch, analyze) and doesn't distinguish this tool from its many siblings that also appear to fetch financial data (like get_balance_data, get_cash_flow_data). The purpose is vague and provides minimal actionable information.

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. With numerous sibling tools for financial data (e.g., get_balance_data, get_cash_flow_data, get_dividend_data), there's no indication of what makes 'profitability data' unique or when it should be preferred. No context, exclusions, or prerequisites are mentioned.

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