Skip to main content
Glama
BACH-AI-Tools

Finmap MCP Server

list_exchanges

Retrieve supported stock exchanges with IDs, names, country, currency, earliest available dates, and update frequencies for accessing historical market data.

Instructions

Return supported exchanges with IDs, names, country, currency, earliest available date, and update frequency.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_exchanges' tool. It maps over the EXCHANGE_INFO object to create a list of exchanges with their details (id, name, country, currency, availableSince, updateFrequency) and returns a formatted response using createResponse, including provider info.
    async () => { try { const exchanges = Object.entries(EXCHANGE_INFO).map(([id, info]) => ({ id, ...info, })); return createResponse({ info: INFO, exchanges }); } catch (error) { return createErrorResponse(error); } },
  • The input/output schema for the 'list_exchanges' tool, defining the title, description, and an empty inputSchema since no parameters are required.
    { title: "List exchanges", description: "Return supported exchanges with IDs, names, country, currency, earliest available date, and update frequency.", inputSchema: {}, },
  • src/core.ts:254-273 (registration)
    The registration of the 'list_exchanges' tool within the registerFinmapTools function using server.registerTool, including the schema and handler inline.
    server.registerTool( "list_exchanges", { title: "List exchanges", description: "Return supported exchanges with IDs, names, country, currency, earliest available date, and update frequency.", inputSchema: {}, }, async () => { try { const exchanges = Object.entries(EXCHANGE_INFO).map(([id, info]) => ({ id, ...info, })); return createResponse({ info: INFO, exchanges }); } catch (error) { return createErrorResponse(error); } }, );
  • The EXCHANGE_INFO constant providing detailed information for each supported stock exchange, directly used in the list_exchanges handler to generate the response.
    const EXCHANGE_INFO: Record< StockExchange, { name: string; country: string; currency: string; availableSince: string; updateFrequency: string; } > = { amex: { name: "American Stock Exchange", country: "United States", currency: "USD", availableSince: "2024-12-09", updateFrequency: "Daily", }, nasdaq: { name: "NASDAQ Stock Market", country: "United States", currency: "USD", availableSince: "2024-12-09", updateFrequency: "Daily", }, nyse: { name: "New York Stock Exchange", country: "United States", currency: "USD", availableSince: "2024-12-09", updateFrequency: "Daily", }, "us-all": { name: "US Combined (AMEX + NASDAQ + NYSE)", country: "United States", currency: "USD", availableSince: "2024-12-09", updateFrequency: "Daily", }, lse: { name: "London Stock Exchange", country: "United Kingdom", currency: "GBP", availableSince: "2025-02-07", updateFrequency: "Hourly (weekdays)", }, moex: { name: "Moscow Exchange", country: "Russia", currency: "RUB", availableSince: "2011-12-19", updateFrequency: "Every 15 minutes (weekdays)", }, bist: { name: "Borsa Istanbul", country: "Turkey", currency: "TRY", availableSince: "2015-11-30", updateFrequency: "Every two months", }, hkex: { name: "Hong Kong Stock Exchange", country: "Hong Kong", currency: "HKD", availableSince: "2025-09-29", updateFrequency: "Every 30 minutes (weekdays)", }, };
  • The createResponse helper function used by the list_exchanges handler to format the output as MCP content with JSON-stringified data.
    function createResponse(data: any) { return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }; }

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/BACH-AI-Tools/bach-finmap-mcp'

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