Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_exchange_rate

Retrieve exchange rates for all currency pairs from Vietnam's stock market. Specify a date or get today's rates in JSON or dataframe format.

Instructions

Get exchange rate of all currency pairs from stock market
Args:
    date: str = None (if None, return today's price. Format: YYYY-MM-DD)
    output_format: Literal['json', 'dataframe'] = 'json'
Returns:
    pd.DataFrame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo
output_formatNojson

Implementation Reference

  • The handler function for the 'get_exchange_rate' MCP tool. Decorated with @server.tool() for automatic registration and schema inference from type hints and docstring. Fetches exchange rates using the vnstock library's vcb_exchange_rate function.
    @server.tool()
    def get_exchange_rate(
        date: str = None, output_format: Literal["json", "dataframe"] = "json"
    ):
        """
        Get exchange rate of all currency pairs from stock market
        Args:
            date: str = None (if None, return today's price. Format: YYYY-MM-DD)
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame
        """
        if not date:
            date = datetime.now().strftime("%Y-%m-%d")
        price = vcb_exchange_rate(date=date)
        if output_format == "json":
            return price.to_json(orient="records", force_ascii=False)
        else:
            return price
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that it returns today's price if date is None and specifies the return type as pd.DataFrame, which is useful behavioral context. However, it doesn't mention rate limits, authentication needs, data freshness, or potential errors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with clear sections (Args, Returns) and every sentence adds value. It's front-loaded with the core purpose, followed by parameter details, with zero redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 2 parameters, no annotations, and no output schema, the description does well by explaining parameter semantics and return type. However, it could better address behavioral aspects like rate limits or data sources. The output format explanation helps compensate for the missing output schema.

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. While schema description coverage is 0%, the description explains both parameters thoroughly: date format (YYYY-MM-DD) and default behavior (today's price if None), and output_format options with their meanings. This fully compensates for the lack of schema 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 verb 'Get' and resource 'exchange rate of all currency pairs from stock market', which is specific and unambiguous. It distinguishes from siblings by focusing on exchange rates rather than company data, funds, or other financial instruments. However, it doesn't explicitly differentiate from all sibling tools by name.

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?

The description provides no guidance on when to use this tool versus alternatives. While it's clear this is for exchange rates, there's no mention of when to choose this over other financial data tools in the sibling list, nor any prerequisites or constraints for usage.

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