Skip to main content
Glama
maven81g

TradeStation MCP Server

by maven81g

getOptionStrikes

Retrieve available strike prices for options contracts on a specified underlying symbol, with optional expiration date filtering to identify trading opportunities.

Instructions

Get available strike prices for options on an underlying symbol

Input Schema

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

Implementation Reference

  • The handler function for the getOptionStrikes tool. It constructs the API endpoint based on underlying symbol and optional expiration, calls makeAuthenticatedRequest to fetch strikes from TradeStation API, and returns JSON-formatted response or error.
    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 }; } } );
  • Zod input schema defining parameters for the getOptionStrikes tool: required 'underlying' symbol and optional 'expiration' date.
    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, specifying name, description, input schema, and 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