Skip to main content
Glama
ariesanhthu

VNStock MCP Server

by ariesanhthu

get_all_symbols_by_industry

Retrieve stock symbols from Vietnam's market filtered by industry sector, with options for JSON or DataFrame output formats.

Instructions

Get all symbols from stock market
Args:
    industry: str = None (if None, return all symbols)
    output_format: Literal['json', 'dataframe'] = 'json'
Returns:
    pd.DataFrame or json

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
industryNo
output_formatNojson

Implementation Reference

  • The handler function for the 'get_all_symbols_by_industry' tool. It retrieves all symbols grouped by industries using VCIListing.symbols_by_industries(), optionally filters by a specific industry code across ICB code columns, and returns the result in JSON or DataFrame format. The @server.tool() decorator registers this function as an MCP tool.
    @server.tool()
    def get_all_symbols_by_industry(
        industry: str = None, output_format: Literal["json", "dataframe"] = "json"
    ):
        """
        Get all symbols from stock market
        Args:
            industry: str = None (if None, return all symbols)
            output_format: Literal['json', 'dataframe'] = 'json'
        Returns:
            pd.DataFrame or json
        """
        listing = VCIListing()
        df = listing.symbols_by_industries()
        if industry:
            codes = ["icb_code1", "icb_code2", "icb_code3", "icb_code4"]
            masks = []
            for col in codes:
                if col in df.columns:
                    masks.append(df[col].astype(str) == industry)
            if masks:
                mask = masks[0]
                for m in masks[1:]:
                    mask = mask | m
                df = df[mask]
        if output_format == "json":
            return df.to_json(orient="records", force_ascii=False)
        else:
            return df
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions return types (pd.DataFrame or json) but lacks behavioral details such as rate limits, authentication needs, data freshness, error handling, or whether it's read-only/destructive. This is a significant gap for a tool with no annotation coverage.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the main purpose, followed by parameter and return details. It uses bullet-like formatting for clarity, though the structure could be slightly more polished. Every sentence adds value without waste.

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

Completeness3/5

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

Given no annotations, no output schema, and low schema coverage, the description is moderately complete. It covers the basic purpose, parameters, and returns, but lacks context on behavioral traits, error cases, or integration with siblings. This is adequate for a simple query tool but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining the 'industry' parameter (if None, return all symbols) and listing output format options, which clarifies beyond the schema. However, it does not fully document both parameters (e.g., what 'industry' values are valid), leaving some gaps.

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 'all symbols from stock market', which specifies what the tool does. It distinguishes from siblings like 'get_all_symbols' by mentioning industry filtering, though not explicitly contrasting them. However, it lacks full sibling differentiation details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through the 'industry' parameter (if None, return all symbols), suggesting when to use it for filtered vs. unfiltered results. However, it does not explicitly state when to use this tool vs. alternatives like 'get_all_symbols' or 'get_all_symbols_by_group', nor provide exclusions or prerequisites.

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