Skip to main content
Glama

TradeStation MCP Server

by maven81g

getOptionStrikes

Retrieve available strike prices for options contracts on a specific stock or ETF symbol. Filter results by expiration date to find suitable trading opportunities.

Instructions

Get available strike prices for options on an underlying symbol

Input Schema

NameRequiredDescriptionDefault
underlyingYesUnderlying symbol (e.g., AAPL, SPY)
expirationNoExpiration date filter in YYYY-MM-DD format (optional)

Input Schema (JSON Schema)

{ "properties": { "expiration": { "description": "Expiration date filter in YYYY-MM-DD format (optional)", "type": "string" }, "underlying": { "description": "Underlying symbol (e.g., AAPL, SPY)", "type": "string" } }, "required": [ "underlying" ], "type": "object" }

Implementation Reference

  • Handler function that constructs the TradeStation API endpoint for option strikes based on underlying symbol and optional expiration date, fetches data using makeAuthenticatedRequest, and returns JSON-formatted response or error.
    async (args) => { try { const { underlying, expiration } = args; let endpoint = `/marketdata/options/strikes/${encodeURIComponent(underlying)}`; if (expiration) { endpoint += `?expiration=${encodeURIComponent(expiration)}`; } const strikes = await makeAuthenticatedRequest(endpoint); return { content: [ { type: "text", text: JSON.stringify(strikes, null, 2) } ] }; } catch (error: unknown) { return { content: [ { type: "text", text: `Failed to fetch option strikes: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
  • Zod input schema defining parameters for getOptionStrikes: required 'underlying' string and optional 'expiration' string.
    const optionStrikesSchema = { underlying: z.string().describe('Underlying symbol (e.g., AAPL, SPY)'), expiration: z.string().optional().describe('Expiration date filter in YYYY-MM-DD format (optional)') };
  • src/index.ts:401-437 (registration)
    MCP server tool registration for 'getOptionStrikes' including name, description, schema reference, and inline handler function.
    server.tool( "getOptionStrikes", "Get available strike prices for options on an underlying symbol", optionStrikesSchema, async (args) => { try { const { underlying, expiration } = args; let endpoint = `/marketdata/options/strikes/${encodeURIComponent(underlying)}`; if (expiration) { endpoint += `?expiration=${encodeURIComponent(expiration)}`; } const strikes = await makeAuthenticatedRequest(endpoint); return { content: [ { type: "text", text: JSON.stringify(strikes, null, 2) } ] }; } catch (error: unknown) { return { content: [ { type: "text", text: `Failed to fetch option strikes: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );

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

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