Skip to main content
Glama
maven81g

TradeStation MCP Server

by maven81g

getOptionExpirations

Retrieve available expiration dates for options contracts on a specific underlying symbol to support trading decisions and strategy planning.

Instructions

Get available expiration dates for options on an underlying symbol

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
underlyingYesUnderlying symbol (e.g., AAPL, SPY)

Implementation Reference

  • Input schema defining the 'underlying' parameter for the getOptionExpirations tool.
    const optionExpirationsSchema = { underlying: z.string().describe('Underlying symbol (e.g., AAPL, SPY)') };
  • The complete tool handler registration and implementation for 'getOptionExpirations'. It extracts the 'underlying' symbol from arguments, makes an authenticated API request to the TradeStation endpoint `/marketdata/options/expirations/{underlying}`, and returns the JSON response or error.
    server.tool( "getOptionExpirations", "Get available expiration dates for options on an underlying symbol", optionExpirationsSchema, async (args) => { try { const { underlying } = args; const expirations = await makeAuthenticatedRequest( `/marketdata/options/expirations/${encodeURIComponent(underlying)}` ); return { content: [ { type: "text", text: JSON.stringify(expirations, null, 2) } ] }; } catch (error: unknown) { return { content: [ { type: "text", text: `Failed to fetch option expirations: ${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