Skip to main content
Glama

Indian Stock Exchange MCP Server

by nikhilcherry
verify-tools.js•1.93 kB
// Verify updated MCP tools logic import * as dotenv from "dotenv"; dotenv.config(); const BASE_URL = "https://stock.indianapi.in"; const API_KEY = process.env.ISE_API_KEY; console.log("šŸ” Verifying Updated MCP Tools Logic..."); async function testTool(name, url) { console.log(`\nšŸ› ļø Tool: ${name}`); console.log(` URL: ${url}`); try { const response = await fetch(url, { headers: { "x-api-key": API_KEY || "" } }); if (response.ok) { const data = await response.json(); const preview = JSON.stringify(data).substring(0, 100); console.log(` āœ… Success! Data: ${preview}...`); // Specific check for stock price logic if (name === "get-stock-price" && data.currentPrice) { console.log(` šŸ’° Price extracted: ${data.currentPrice}`); } } else { console.log(` āŒ Failed: ${response.status} ${response.statusText}`); } } catch (e) { console.log(` āŒ Error: ${e.message}`); } } async function runTests() { await testTool("get-news", `${BASE_URL}/news`); await testTool("get-stock-details", `${BASE_URL}/stock?name=Reliance`); await testTool("get-stock-price", `${BASE_URL}/stock?name=Reliance`); await testTool("get-stock-history", `${BASE_URL}/historical?stock_name=Reliance&period=1m&filter=default`); await testTool("get-trending-stocks", `${BASE_URL}/trending`); await testTool("get-top-gainers", `${BASE_URL}/stock/gainers`); await testTool("get-top-losers", `${BASE_URL}/stock/losers`); await testTool("get-bse-active", `${BASE_URL}/bse_most_active_stocks`); await testTool("get-nse-active", `${BASE_URL}/nse_most_active_stocks`); await testTool("get-commodities", `${BASE_URL}/commodities`); await testTool("get-price-shockers", `${BASE_URL}/price_shockers`); } runTests();

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/nikhilcherry/Indian-stock-MCP'

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