Skip to main content
Glama
24mlight

A Share MCP

get_dupont_data

Retrieve quarterly DuPont analysis data for A-share stocks to assess financial performance through return on equity decomposition.

Instructions

Quarterly Dupont analysis data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
yearYes
quarterYes
limitNo
formatNomarkdown

Implementation Reference

  • MCP tool handler for get_dupont_data. Decorated with @app.tool(), validates inputs indirectly via use case, delegates to fetch_dupont_data use case wrapped in run_tool_with_handling for error handling and caching.
    @app.tool()
    def get_dupont_data(code: str, year: str, quarter: int, limit: int = 250, format: str = "markdown") -> str:
        """Quarterly Dupont analysis data."""
        return run_tool_with_handling(
            lambda: fetch_dupont_data(active_data_source, code=code, year=year, quarter=quarter, limit=limit, format=format),
            context=f"get_dupont_data:{code}:{year}Q{quarter}",
        )
  • mcp_server.py:51-58 (registration)
    Registration of all tool groups in the main MCP server, including financial_report_tools which defines and registers the get_dupont_data tool.
    register_stock_market_tools(app, active_data_source)
    register_financial_report_tools(app, active_data_source)
    register_index_tools(app, active_data_source)
    register_market_overview_tools(app, active_data_source)
    register_macroeconomic_tools(app, active_data_source)
    register_date_utils_tools(app, active_data_source)
    register_analysis_tools(app, active_data_source)
    register_helpers_tools(app)
  • Use case helper: fetch_dupont_data performs validation, fetches raw DataFrame from data_source, and formats output as markdown or other.
    def fetch_dupont_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_dupont_data(code=code, year=year, quarter=quarter)
        return _format_financial_df(df, code=code, year=year, quarter=quarter, dataset="Dupont", format=format, limit=limit)
  • Data source implementation: get_dupont_data delegates to Baostock's query_dupont_data via shared _fetch_financial_data helper with error handling.
    def get_dupont_data(self, code: str, year: str, quarter: int) -> pd.DataFrame:
        """Fetches quarterly DuPont analysis data using Baostock."""
        return _fetch_financial_data(bs.query_dupont_data, "DuPont Analysis", code, year, quarter)
  • Interface definition specifying the input schema (code: str, year: str, quarter: int) and output type (pd.DataFrame) for the data fetching method.
    @abstractmethod
    def get_dupont_data(self, code: str, year: str, quarter: int) -> pd.DataFrame:
        pass
Behavior2/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 only states what data is provided without describing how it behaves—e.g., whether it's a read-only query, if it requires authentication, rate limits, error handling, or what the output looks like (since no output schema exists). This leaves significant gaps for an agent to understand the tool's operation.

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 Dupont analysis data.', which is front-loaded and wastes no words. However, this conciseness comes at the cost of completeness, but as per the dimension, it scores high for being brief and structured.

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

Completeness2/5

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

Given the complexity (5 parameters, 3 required, no annotations, no output schema), the description is incomplete. It doesn't explain the tool's behavior, parameters, or output, leaving the agent with insufficient information to use it effectively. The lack of annotations and output schema increases the burden on the description, which it doesn't meet.

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

Parameters2/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 (code, year, quarter, limit, format) are explained in the schema. The description adds no parameter semantics—it doesn't clarify what 'code' refers to (e.g., stock ticker), the format of 'year' and 'quarter', or what 'format' options exist. This fails to compensate for the low schema coverage.

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 Dupont analysis data' states what the tool provides (Dupont analysis data) and indicates temporal scope (quarterly), which gives a basic purpose. However, it lacks a specific verb (e.g., 'retrieve' or 'fetch') and doesn't differentiate from siblings like 'get_fina_indicator' or 'get_profit_data', which might also provide financial metrics, making it somewhat vague.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions, and with many sibling tools for financial data (e.g., 'get_balance_data', 'get_cash_flow_data'), there's no indication of how Dupont analysis differs or when it's preferred.

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