Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_raw_report

Retrieve raw financial reports for Vietnamese companies by stock symbol, with options for quarterly or annual periods and JSON or dataframe output formats.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
periodNoyear
output_formatNojson

Implementation Reference

  • The main handler function for the 'get_raw_report' MCP tool. It is decorated with @server.tool(), which registers it as an MCP tool and infers the schema from type annotations and docstring. The function fetches raw financial reports using VCIFinance from the vnstock library and returns data in JSON or DataFrame format.
    @server.tool() def get_raw_report( symbol: str, period: Literal["quarter", "year"] = "year", output_format: Literal["json", "dataframe"] = "json", ): # pyright: ignore[reportUndefinedVariable] """ Get raw report of a company from stock market Args: symbol: str (symbol of the company to get raw report) period: Literal['quarter', 'year'] = 'year' (period to get raw report) output_format: Literal['json', 'dataframe'] = 'json' Returns: pd.DataFrame """ finance = VCIFinance(symbol=symbol, period=period) df = finance._get_report(mode="raw") if output_format == "json": return df.to_json(orient="records", force_ascii=False) else: return df

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