Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_gold_price

Retrieve gold prices from Vietnam's stock market for specific dates and sources like SJC or BTMC, returning data 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 handler function for the 'get_gold_price' tool. It is decorated with @server.tool(), serving as both implementation and registration. Handles parameters for date, source (SJC/BTMC), and output format, delegating to vnstock library helpers for data fetching.
    @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

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