Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_balance_sheets

Retrieve company balance sheets from Vietnam's stock market by specifying a stock symbol, period (quarter/year), and preferred output format (JSON/DataFrame).

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
periodNoyear
output_formatNojson

Implementation Reference

  • The primary handler function for the 'get_balance_sheets' MCP tool. It uses VCIFinance to fetch balance sheet data based on symbol and period, formatting output as JSON or DataFrame. The @server.tool() decorator registers it with the FastMCP server.
    @server.tool() def get_balance_sheets( symbol: str, period: Literal["quarter", "year"] = "year", output_format: Literal["json", "dataframe"] = "json", ): # pyright: ignore[reportUndefinedVariable] """ Get balance sheets of a company from stock market Args: symbol: str (symbol of the company to get balance sheets) period: Literal['quarter', 'year'] = 'year' (period to get balance sheets) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ finance = VCIFinance(symbol=symbol, period=period) df = finance.balance_sheet() if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df
  • The @server.tool() decorator registers the get_balance_sheets function as an MCP tool in the FastMCP server instance.
    @server.tool()

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