Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_company_overview

Retrieve company overview data from Vietnam's stock market by providing a stock symbol, with output available in JSON or dataframe format.

Instructions

Get company overview from stock market
Args:
    symbol: str
    output_format: Literal['json', 'dataframe'] = 'json'
Returns:
    pd.DataFrame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
output_formatNojson

Implementation Reference

  • The main handler function for the 'get_company_overview' MCP tool. It is decorated with @server.tool() for registration. Fetches company overview data using TCBSCompany from vnstock and returns it as JSON or pandas DataFrame based on the output_format parameter.
    @server.tool()
    def get_company_overview(
        symbol: str, output_format: Literal["json", "dataframe"] = "json"
    ):
        """
        Get company overview from stock market
        Args:
            symbol: str
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame
        """
        equity = TCBSCompany(symbol=symbol)
        df = equity.overview()
        if output_format == "json":
            return df.to_json(orient="records", force_ascii=False)
        else:
            return df
  • The @server.tool() decorator registers the get_company_overview function as an MCP tool with the FastMCP server.
    @server.tool()
  • Input schema defined by function parameters with type hints (symbol: str, output_format: Literal["json", "dataframe"] = "json") and docstring describing args and return type.
    def get_company_overview(
        symbol: str, output_format: Literal["json", "dataframe"] = "json"
    ):
        """
        Get company overview from stock market
        Args:
            symbol: str
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame
        """

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