Skip to main content
Glama
Long0308

VN Stock API MCP Server

by Long0308

get_stock_price_fireant

Retrieve current stock prices for Vietnam market symbols using FireAnt data sources. Provide stock symbols like VIC or VNM to get real-time pricing information.

Instructions

Get real-time stock price from FireAnt. Uses FireAnt API or web scraping to retrieve current stock prices for Vietnam stock market symbols (e.g., VIC, VNM, VCB).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock symbol (e.g., 'VIC', 'VNM', 'VCB'). Use comma-separated for multiple symbols.

Implementation Reference

  • The main handler function that implements the tool logic: fetches real-time stock prices from FireAnt API endpoints (primary: https://restv2.fireant.vn/stocks/{sym}/quotes, fallback: /symbols/{sym}/intraday), handles multiple symbols, errors, and provides fallback notes.
    private async getStockPriceFireAnt(args: { symbol: string }) {
      const { symbol } = args;
      const symbols = symbol.split(",").map((s) => s.trim().toUpperCase());
    
      try {
        // Try FireAnt API first
        const results: any[] = [];
    
        for (const sym of symbols) {
          try {
            // FireAnt API endpoint for stock quotes
            const apiUrl = `https://restv2.fireant.vn/stocks/${sym}/quotes`;
            const response = await fetch(apiUrl, {
              headers: {
                "User-Agent": "Mozilla/5.0",
                "Accept": "application/json",
              },
            });
    
            if (response.ok) {
              const data = await response.json();
              results.push({
                symbol: sym,
                source: "FireAnt API",
                data: data,
                timestamp: new Date().toISOString(),
              });
            } else {
              // Fallback: Try alternative endpoint
              const altUrl = `https://restv2.fireant.vn/symbols/${sym}/intraday`;
              const altResponse = await fetch(altUrl, {
                headers: {
                  "User-Agent": "Mozilla/5.0",
                  "Accept": "application/json",
                },
              });
    
              if (altResponse.ok) {
                const altData = await altResponse.json();
                results.push({
                  symbol: sym,
                  source: "FireAnt API (alternative)",
                  data: altData,
                  timestamp: new Date().toISOString(),
                });
              } else {
                // If API fails, provide information about how to access
                results.push({
                  symbol: sym,
                  source: "FireAnt",
                  status: "API endpoint may require authentication",
                  note: "FireAnt API may require API key or authentication. Please check FireAnt API documentation or use Firecrawl to scrape from https://www.fireant.vn",
                  documentationUrl: "https://api.fireant.vn/",
                  webUrl: `https://www.fireant.vn/symbol/${sym}`,
                });
              }
            }
          } catch (error) {
            results.push({
              symbol: sym,
              error: error instanceof Error ? error.message : String(error),
              note: "Unable to fetch from API. Consider using Firecrawl MCP to scrape from FireAnt website.",
              webUrl: `https://www.fireant.vn/symbol/${sym}`,
            });
          }
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  provider: "FireAnt",
                  symbols: symbols,
                  results: results,
                  note:
                    results.some((r) => r.note) &&
                    "Some data may require authentication. Consider using Firecrawl MCP server to scrape real-time data from FireAnt website.",
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  error: error instanceof Error ? error.message : String(error),
                  note: "Unable to fetch stock prices. You may need to use Firecrawl MCP to scrape data from FireAnt website at https://www.fireant.vn",
                },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:121-134 (registration)
    Tool registration in the tools list, including name, description, and input schema. This list is returned by ListToolsRequestSchema handler.
      name: "get_stock_price_fireant",
      description:
        "Get real-time stock price from FireAnt. Uses FireAnt API or web scraping to retrieve current stock prices for Vietnam stock market symbols (e.g., VIC, VNM, VCB).",
      inputSchema: {
        type: "object",
        properties: {
          symbol: {
            type: "string",
            description: "Stock symbol (e.g., 'VIC', 'VNM', 'VCB'). Use comma-separated for multiple symbols.",
          },
        },
        required: ["symbol"],
      },
    },
  • Dispatch case in CallToolRequestSchema handler that routes to the getStockPriceFireAnt implementation.
    case "get_stock_price_fireant":
      return await this.getStockPriceFireAnt(args as any);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the data source (FireAnt API/web scraping) and real-time nature, but doesn't address important behavioral aspects like rate limits, authentication requirements, error conditions, response format, or whether this is a read-only operation. The description provides some context but leaves significant gaps for a tool that presumably makes external API calls.

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 concise with two sentences that each add value. The first sentence states the core purpose, and the second provides implementation details and market context. There's no wasted verbiage, though it could be slightly more front-loaded with the most critical information.

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

Completeness2/5

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

For a tool with no annotations, no output schema, and that presumably makes external API calls, the description is incomplete. It doesn't address response format, error handling, rate limits, or authentication requirements. While it specifies the market focus and data source, important contextual information about how to interpret results or handle failures is missing.

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 100%, so the schema already fully documents the single parameter. The description adds minimal value beyond the schema by providing example symbols (VIC, VNM, VCB) and mentioning 'Vietnam stock market symbols', but doesn't explain parameter semantics beyond what's in the schema description. This meets the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get real-time stock price'), identifies the resource ('from FireAnt'), and distinguishes from siblings by specifying the data source (FireAnt API/web scraping) and market focus (Vietnam stock market symbols). It goes beyond just restating the name by detailing the implementation method and geographic scope.

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 context by mentioning 'Vietnam stock market symbols' and providing examples, but doesn't explicitly state when to use this tool versus alternatives like 'list_vn_stocks' or 'search_vn_stock_api'. No guidance is given about when-not-to-use or specific prerequisites for operation.

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/Long0308/vn-stock-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server