Skip to main content
Glama
Long0308

VN Stock API MCP Server

by Long0308

get_api_endpoints

Retrieve specific API endpoints for Vietnamese stock data providers including VNDirect, FireAnt, and SSI. Get detailed endpoint information with URLs, methods, and descriptions for accessing market data, trading, and account services.

Instructions

Get specific API endpoints for a provider. Returns detailed endpoint information including URLs, methods, and descriptions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
providerYesStock API provider
categoryNoOptional category filter (e.g., 'trading', 'market-data', 'account')

Implementation Reference

  • The primary handler function for the 'get_api_endpoints' tool. It retrieves endpoints for the specified provider, optionally filters by category, and returns a JSON-formatted response with the endpoint details.
    private async getAPIEndpoints(args: { provider: "vndirect" | "fireant" | "ssi"; category?: string; }) { const { provider, category } = args; const endpoints = this.getEndpointsForProvider(provider); const filteredEndpoints = category ? endpoints.filter( (ep: any) => ep.category?.toLowerCase() === category.toLowerCase() || ep.name?.toLowerCase().includes(category.toLowerCase()) ) : endpoints; return { content: [ { type: "text", text: JSON.stringify( { provider, category: category || "all", endpoints: filteredEndpoints, }, null, 2 ), }, ], }; }
  • The tool schema definition including name, description, and input schema for validating parameters (provider required, category optional). This is part of the tools array registered with the MCP server.
    { name: "get_api_endpoints", description: "Get specific API endpoints for a provider. Returns detailed endpoint information including URLs, methods, and descriptions.", inputSchema: { type: "object", properties: { provider: { type: "string", enum: ["vndirect", "fireant", "ssi"], description: "Stock API provider", }, category: { type: "string", description: "Optional category filter (e.g., 'trading', 'market-data', 'account')", }, }, required: ["provider"], }, },
  • src/index.ts:226-226 (registration)
    The switch case in the CallToolRequestSchema handler that routes calls to the 'get_api_endpoints' tool to its handler method.
    return await this.getAPIEndpoints(args as any);
  • Helper method that provides the actual endpoint data for each provider (vndirect, fireant, ssi). Called by the handler and also used in search_vn_stock_api tool.
    private getEndpointsForProvider( provider: "vndirect" | "fireant" | "ssi" ): any[] { switch (provider) { case "vndirect": return [ { name: "Open API", description: "VNDirect Open API for trading and market data", url: "https://www.vndirect.com.vn/san-pham-to-chuc/apis-white-labeling/", category: "trading", }, { name: "D-Stock Data API", description: "Real-time market data and financial information", url: "https://dstock.vndirect.com.vn/", category: "market-data", }, ]; case "fireant": return [ { name: "FireAnt API", description: "FireAnt API for Vietnam stock market data", baseUrl: "https://api.fireant.vn", endpoints: [ { path: "/fmarket/accounts/get-account-info", method: "GET", description: "Get account information", }, ], category: "account", }, ]; case "ssi": return [ { name: "FastConnect Trading API", description: "SSI FastConnect Trading API", baseUrl: "https://fc-tradeapi.ssi.com.vn/api/v2", endpoints: [ { path: "/stock/transferable", method: "GET", description: "Query transferable stock information", }, ], category: "trading", documentation: "https://guide.ssi.com.vn/ssi-products/tieng-viet/fastconnect-trading/danh-sach-cac-api", }, { name: "FastConnect Data API", description: "SSI FastConnect Data API", category: "market-data", documentation: "https://github.com/SSI-Securities-Corporation/docs", }, ]; default: return []; } }

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