Skip to main content
Glama
Long0308

VN Stock API MCP Server

by Long0308

get_api_endpoints

Retrieve API endpoints for Vietnamese stock market providers like VNDirect, FireAnt, and SSI, including URLs, methods, and descriptions for accessing market data, trading, and account information.

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

  • Main handler function for the 'get_api_endpoints' tool. It takes provider and optional category, fetches endpoints using getEndpointsForProvider, filters if category specified, and returns JSON-formatted response.
    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 ), }, ], }; }
  • Tool schema definition including input schema for validation: requires 'provider' (vndirect, fireant, ssi), optional 'category'.
    { 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:225-226 (registration)
    Registration of the tool handler in the switch statement within CallToolRequestSchema handler.
    case "get_api_endpoints": return await this.getAPIEndpoints(args as any);
  • Helper function that returns hardcoded API endpoint information for each provider. Called by the handler to get the data.
    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 []; } }
  • src/index.ts:214-216 (registration)
    Handler for ListToolsRequestSchema that returns the list of tools including get_api_endpoints.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: this.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