Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_finance_ratios

Retrieve financial ratios for Vietnamese companies to analyze performance and make investment decisions. Specify stock symbol, period (quarter/year), and output format (JSON/DataFrame).

Instructions

Get finance ratios of a company from stock market
Args:
    symbol: str (symbol of the company to get finance ratios)
    period: Literal['quarter', 'year'] = 'year' (period to get finance ratios)
    output_format: Literal['json', 'dataframe'] = 'json'
Returns:
    pd.DataFrame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
periodNoyear
output_formatNojson

Implementation Reference

  • Full implementation of the get_finance_ratios tool, including registration decorator (@server.tool()), type-annotated schema (parameters), and execution logic using VCIFinance.ratio() to fetch financial ratios and return as JSON or DataFrame.
    @server.tool()
    def get_finance_ratios(
        symbol: str,
        period: Literal["quarter", "year"] = "year",
        output_format: Literal["json", "dataframe"] = "json",
    ):  # pyright: ignore[reportUndefinedVariable]
        """
        Get finance ratios of a company from stock market
        Args:
            symbol: str (symbol of the company to get finance ratios)
            period: Literal['quarter', 'year'] = 'year' (period to get finance ratios)
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame
        """
        finance = VCIFinance(symbol=symbol, period=period)
        df = finance.ratio()
        if output_format == "json":
            return df.to_json(orient="records", force_ascii=False)
        else:
            return df
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return type ('pd.DataFrame') and output formats, but lacks critical information such as data sources, rate limits, authentication requirements, error handling, or whether this is a read-only operation. For a financial data tool with no annotation coverage, this is a significant gap in transparency.

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

Conciseness3/5

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

The description is reasonably concise with clear sections (Args, Returns), but could be more front-loaded. The first sentence states the purpose, but the parameter explanations are somewhat redundant with the schema (though necessary given 0% schema coverage). The structure is functional but not optimal for quick scanning.

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

Completeness3/5

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

Given the complexity of financial data retrieval with 3 parameters and no output schema, the description is moderately complete. It covers the basic purpose and parameters but lacks details about the returned finance ratios (what metrics, units, time periods), data freshness, or error cases. Without annotations or output schema, more context about the tool's behavior would be helpful.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds substantial value beyond the input schema, which has 0% description coverage. It explains that 'symbol' is the company symbol, 'period' can be 'quarter' or 'year', and 'output_format' can be 'json' or 'dataframe'. This compensates well for the schema's lack of descriptions, though it doesn't elaborate on what specific finance ratios are returned or their format.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get finance ratios of a company from stock market'. It specifies the verb ('Get'), resource ('finance ratios'), and source ('stock market'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_company_ratio_summary' or 'get_company_overview', which might provide similar 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 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 sibling tools like 'get_company_ratio_summary' or explain what distinguishes this tool from others that might provide financial ratios or summaries. The user is left to infer usage based on the tool name and parameters alone.

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/ariesanhthu/mcp-server-vietnam-stock-trading'

If you have feedback or need assistance with the MCP directory API, please join our Discord server