Skip to main content
Glama

TradeStation MCP Server

by maven81g
test-specific-endpoints.js2.17 kB
// Test specific endpoints to find correct API paths import axios from 'axios'; import dotenv from 'dotenv'; dotenv.config(); const TS_TOKEN_URL = 'https://signin.tradestation.com/oauth/token'; const TS_API_BASE = 'https://sim-api.tradestation.com/v3'; async function getAccessToken() { const response = await axios.post(TS_TOKEN_URL, 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 response.data.access_token; } async function testEndpoint(url, token) { try { const response = await axios.get(`${TS_API_BASE}${url}`, { headers: { 'Authorization': `Bearer ${token}`, 'Accept': 'application/json' } }); console.log(`✅ ${url}`); console.log(JSON.stringify(response.data, null, 2).substring(0, 400)); return true; } catch (error) { console.log(`❌ ${url} - ${error.response?.status}: ${error.response?.data?.Message || error.message}`); return false; } } async function main() { const token = await getAccessToken(); console.log('\n=== Testing Symbol Search Endpoints ==='); await testEndpoint('/marketdata/symbollookup?criteria=Apple', token); await testEndpoint('/marketdata/symbols/search/AAPL', token); await testEndpoint('/marketdata/symbols/search?criteria=AAPL', token); console.log('\n=== Testing Option Chain Endpoints ==='); await testEndpoint('/marketdata/options/expirations/SPXW', token); await testEndpoint('/marketdata/options/chains/SPXW', token); await testEndpoint('/marketdata/options/quotes/SPXW', token); await testEndpoint('/marketdata/options/strikes/SPXW', token); console.log('\n=== Testing Symbol Detail Formats ==='); await testEndpoint('/marketdata/symbols/SPXW', token); await testEndpoint('/marketdata/symboldetails/SPXW', token); } main().catch(console.error);

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