Skip to main content
Glama

TradeStation MCP Server

by maven81g
test-valid-symbols.js1.55 kB
import axios from 'axios'; import dotenv from 'dotenv'; dotenv.config(); const TS_API_BASE = 'https://sim-api.tradestation.com/v3'; async function getToken() { const r = await axios.post('https://signin.tradestation.com/oauth/token', new URLSearchParams({ grant_type: 'refresh_token', client_id: process.env.TRADESTATION_CLIENT_ID, client_secret: process.env.TRADESTATION_CLIENT_SECRET, refresh_token: process.env.TRADESTATION_REFRESH_TOKEN }), { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); return r.data.access_token; } async function test(url, token) { try { const r = await axios.get(`${TS_API_BASE}${url}`, { headers: { 'Authorization': `Bearer ${token}`, 'Accept': 'application/json' } }); console.log(`✅ ${url}`); console.log(JSON.stringify(r.data, null, 2).substring(0, 300) + '...\n'); } catch (e) { const msg = e.response?.data?.Message || e.response?.data?.message || e.message; console.log(`❌ ${url} - ${e.response?.status}: ${msg}\n`); } } const token = await getToken(); console.log('=== Symbol Search (with SPY) ==='); await test('/marketdata/symbols/search/SPY', token); console.log('=== Options for AAPL ==='); await test('/marketdata/options/expirations/AAPL', token); await test('/marketdata/options/strikes/AAPL', token); await test('/marketdata/options/chains/AAPL', token); console.log('=== Try specific option symbol ==='); await test('/marketdata/quotes/AAPL 251219C250', token);

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/maven81g/tradestation_mcp'

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