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,
    }));
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 of behavioral disclosure. It mentions that the tool returns detailed endpoint information, but it does not describe key behavioral traits such as whether it requires authentication, has rate limits, handles errors, or if the data is static or dynamic. This leaves significant gaps for a tool that interacts with API endpoints.

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, consisting of two clear sentences that state the tool's purpose and return value without unnecessary details. However, it could be slightly more concise by combining ideas, but it efficiently communicates the core functionality.

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 the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and return information but lacks details on behavioral aspects, error handling, or output structure, which are important for API-related tools. This results in a score that reflects partial completeness with notable 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?

The schema description coverage is 100%, so the schema already documents both parameters ('provider' and 'category') with descriptions and an enum for 'provider'. The description adds no additional meaning or context beyond what the schema provides, such as examples of categories or provider details, resulting in a baseline score of 3.

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 tool's purpose with specific verbs ('Get') and resources ('specific API endpoints for a provider'), and it specifies what information is returned ('detailed endpoint information including URLs, methods, and descriptions'). However, it does not explicitly distinguish this tool from sibling tools like 'get_api_documentation_urls' or 'search_vn_stock_api', which might have overlapping or related functionality, preventing a score of 5.

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, such as sibling tools like 'get_api_documentation_urls' or 'search_vn_stock_api'. It lacks explicit context, exclusions, or prerequisites, offering only a basic functional statement without usage instructions.

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