Skip to main content
Glama
Long0308

VN Stock API MCP Server

by Long0308

search_vn_stock_api

Search API documentation and endpoints for Vietnamese stock market data providers VNDirect, FireAnt, and SSI to find available APIs, endpoints, and documentation URLs.

Instructions

Search for API documentation and endpoints from VNDirect, FireAnt, or SSI. Returns information about available APIs, endpoints, and documentation URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
providerYesStock API provider to search. Use 'all' to get information from all providers.
queryNoOptional search query to filter results (e.g., 'trading', 'market data', 'authentication')

Implementation Reference

  • The main handler function that implements the logic for the 'search_vn_stock_api' tool. It searches for API information from specified providers (vndirect, fireant, ssi, or all), optionally filters by query, and returns structured results including endpoints.
    private async searchVNStockAPI(args: {
      provider: "vndirect" | "fireant" | "ssi" | "all";
      query?: string;
    }) {
      const { provider, query } = args;
      const results: any[] = [];
    
      const providersToSearch =
        provider === "all"
          ? (Object.keys(API_SOURCES) as Array<keyof typeof API_SOURCES>)
          : [provider];
    
      for (const prov of providersToSearch) {
        const source = API_SOURCES[prov];
        const info: any = {
          provider: prov,
          name: source.name,
          description: source.description,
          baseUrl: source.baseUrl,
          documentationUrls: source.apiDocs,
          endpoints: this.getEndpointsForProvider(prov),
        };
    
        if (query) {
          const lowerQuery = query.toLowerCase();
          const matches =
            source.name.toLowerCase().includes(lowerQuery) ||
            source.description.toLowerCase().includes(lowerQuery) ||
            info.endpoints.some((ep: any) =>
              ep.name?.toLowerCase().includes(lowerQuery) ||
              ep.description?.toLowerCase().includes(lowerQuery)
            );
    
          if (matches) {
            results.push(info);
          }
        } else {
          results.push(info);
        }
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(results, null, 2),
          },
        ],
      };
    }
  • src/index.ts:64-83 (registration)
    Tool registration in the tools array, including name, description, and input schema for 'search_vn_stock_api'.
    {
      name: "search_vn_stock_api",
      description:
        "Search for API documentation and endpoints from VNDirect, FireAnt, or SSI. Returns information about available APIs, endpoints, and documentation URLs.",
      inputSchema: {
        type: "object",
        properties: {
          provider: {
            type: "string",
            enum: ["vndirect", "fireant", "ssi", "all"],
            description: "Stock API provider to search. Use 'all' to get information from all providers.",
          },
          query: {
            type: "string",
            description: "Optional search query to filter results (e.g., 'trading', 'market data', 'authentication')",
          },
        },
        required: ["provider"],
      },
    },
  • Input schema definition for the 'search_vn_stock_api' tool, specifying parameters provider (required, enum) and optional query.
    inputSchema: {
      type: "object",
      properties: {
        provider: {
          type: "string",
          enum: ["vndirect", "fireant", "ssi", "all"],
          description: "Stock API provider to search. Use 'all' to get information from all providers.",
        },
        query: {
          type: "string",
          description: "Optional search query to filter results (e.g., 'trading', 'market data', 'authentication')",
        },
      },
      required: ["provider"],
    },
  • Dispatch in the CallToolRequestSchema handler that routes calls to the searchVNStockAPI method.
    case "search_vn_stock_api":
      return await this.searchVNStockAPI(args as any);
    case "get_api_endpoints":
  • Data structure providing API source information for vndirect, fireant, and ssi providers, used by the search_vn_stock_api handler.
    const API_SOURCES = {
      vndirect: {
        name: "VNDirect",
        baseUrl: "https://www.vndirect.com.vn",
        apiDocs: [
          "https://www.vndirect.com.vn/san-pham-to-chuc/apis-white-labeling/",
          "https://dstock.vndirect.com.vn/",
        ],
        description: "VNDirect Securities Corporation API",
      },
      fireant: {
        name: "FireAnt",
        baseUrl: "https://api.fireant.vn",
        apiDocs: [
          "https://api.fireant.vn/",
        ],
        description: "FireAnt API for Vietnam stock market",
      },
      ssi: {
        name: "SSI",
        baseUrl: "https://fc-tradeapi.ssi.com.vn",
        apiDocs: [
          "https://guide.ssi.com.vn/ssi-products/tieng-viet/fastconnect-trading/danh-sach-cac-api",
          "https://github.com/SSI-Securities-Corporation/docs",
        ],
        description: "SSI FastConnect API",
      },
    };
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 the tool returns 'information about available APIs, endpoints, and documentation URLs', but lacks details on rate limits, authentication needs, error handling, or response format. For a search tool with zero annotation coverage, this is a significant gap in transparency.

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 concise and front-loaded in a single sentence, efficiently stating the tool's purpose and return value. Every sentence earns its place, though it could be slightly more structured by separating provider details from 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 (search with filtering), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose and parameters but lacks details on behavioral traits, response structure, or error handling, leaving gaps for an AI agent to operate effectively.

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 fully documents both parameters. The description adds marginal value by mentioning 'search query to filter results' and listing providers, but doesn't provide additional syntax, format details, or examples beyond what the schema specifies. Baseline 3 is appropriate when the schema handles parameter documentation.

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: 'Search for API documentation and endpoints from VNDirect, FireAnt, or SSI' with the specific verb 'search' and resources 'API documentation and endpoints'. It distinguishes from siblings like 'get_api_documentation_urls' and 'get_api_endpoints' by emphasizing search functionality with filtering, though it doesn't explicitly contrast them.

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 by listing providers and mentioning filtering with a query, but it doesn't explicitly state when to use this tool versus alternatives like 'get_api_documentation_urls' or 'get_api_endpoints'. No exclusions or prerequisites are provided, leaving usage context inferred rather than clearly defined.

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