Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_gold_price

Retrieve current or historical gold prices from Vietnam's stock market sources like SJC or BTMC in JSON or dataframe format.

Instructions

Get gold price from stock market
Args:
    date: str = None (if None, return today's price. Format: YYYY-MM-DD)
    source: Literal['SJC', 'BTMC'] = 'SJC' (source to get gold price)
    output_format: Literal['json', 'dataframe'] = 'json'
Returns:
    pd.DataFrame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo
sourceNoSJC
output_formatNojson

Implementation Reference

  • The primary handler implementation for the 'get_gold_price' MCP tool. It is registered via the @server.tool() decorator, defines the input schema via type annotations and defaults, and executes the logic by calling underlying vnstock functions (sjc_gold_price or btmc_goldprice) based on parameters, formatting output as JSON or pandas DataFrame.
    @server.tool()
    def get_gold_price(
        date: str = None,
        source: Literal["SJC", "BTMC"] = "SJC",
        output_format: Literal["json", "dataframe"] = "json",
    ):  # pyright: ignore[reportUndefinedVariable]  # noqa: F821
        """
        Get gold price from stock market
        Args:
            date: str = None (if None, return today's price. Format: YYYY-MM-DD)
            source: Literal['SJC', 'BTMC'] = 'SJC' (source to get gold price)
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame
        """
        if date:
            price = sjc_gold_price(date=date)
            if output_format == "json":
                return price.to_json(orient="records", force_ascii=False)
            else:
                return price
        else:
            price = sjc_gold_price() if source == "SJC" else btmc_goldprice()
            if output_format == "json":
                return price.to_json(orient="records", force_ascii=False)
            else:
                return price
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) but lacks critical details: whether this is a read-only operation, potential rate limits, authentication requirements, error handling, or what happens with invalid dates/sources. The description is minimal beyond basic parameter info.

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 efficiently structured with clear sections (Args, Returns) and uses minimal sentences. Every line adds value: the first sentence states the purpose, and subsequent lines document parameters and return type without redundancy. It could be slightly more front-loaded with behavioral context.

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 3 parameters with no schema descriptions and no output schema, the description does well on parameters but lacks behavioral context. It explains what the tool does and documents parameters thoroughly, but for a financial data tool with potential complexities (rate limits, data freshness, source differences), more operational guidance would be beneficial.

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

Parameters5/5

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

The description adds significant value beyond the input schema, which has 0% description coverage. It explains all three parameters: 'date' (with None default meaning today's price and format specification), 'source' (with enum values and default), and 'output_format' (with enum values and default). This fully compensates for the schema's lack of descriptions.

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 gold price from stock market' specifies the action (get) and resource (gold price). It distinguishes itself from siblings by focusing on gold prices rather than company data, funds, or other financial instruments, though it doesn't explicitly contrast with similar tools.

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. The description doesn't mention prerequisites, context for selecting between 'SJC' and 'BTMC' sources, or when to choose different output formats. Usage is implied through parameter defaults but not explained.

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