searchSymbols
Find trading symbols by search criteria and filter by asset type to identify securities for market analysis and trading decisions.
Instructions
Search for symbols (Note: Symbol search not available in TradeStation v3 API - use getSymbolDetails instead with known symbols)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| criteria | Yes | Search criteria | |
| type | No | Symbol type filter | all |
Input Schema (JSON Schema)
{
"properties": {
"criteria": {
"description": "Search criteria",
"type": "string"
},
"type": {
"default": "all",
"description": "Symbol type filter",
"enum": [
"stock",
"option",
"future",
"forex",
"all"
],
"type": "string"
}
},
"required": [
"criteria"
],
"type": "object"
}
Implementation Reference
- src/index.ts:340-364 (handler)The inline handler function for the 'searchSymbols' MCP tool. It returns an error message explaining that symbol search is not supported in TradeStation API v3 and provides alternatives.async (args) => { try { const { criteria } = args; return { content: [ { type: "text", text: `Symbol search is not available in TradeStation API v3.\n\nAlternatives:\n1. Use getSymbolDetails with known symbols: "${criteria}"\n2. Use marketData to get quotes for known symbols\n3. For options, use getOptionExpirations and getOptionStrikes with the underlying symbol` } ], isError: true }; } catch (error: unknown) { return { content: [ { type: "text", text: `Failed to search symbols: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/index.ts:85-90 (schema)Zod schema defining the input parameters (criteria and optional type filter) for the searchSymbols tool.const searchSymbolsSchema = { criteria: z.string().describe('Search criteria'), type: z.enum(['stock', 'option', 'future', 'forex', 'all']) .default('all') .describe('Symbol type filter') };
- src/index.ts:337-365 (registration)MCP server tool registration for 'searchSymbols', including name, description, schema, and inline handler."searchSymbols", "Search for symbols (Note: Symbol search not available in TradeStation v3 API - use getSymbolDetails instead with known symbols)", searchSymbolsSchema, async (args) => { try { const { criteria } = args; return { content: [ { type: "text", text: `Symbol search is not available in TradeStation API v3.\n\nAlternatives:\n1. Use getSymbolDetails with known symbols: "${criteria}"\n2. Use marketData to get quotes for known symbols\n3. For options, use getOptionExpirations and getOptionStrikes with the underlying symbol` } ], isError: true }; } catch (error: unknown) { return { content: [ { type: "text", text: `Failed to search symbols: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );
- index.js:508-539 (handler)Alternative inline handler in index.js version that attempts to call a symbol search API endpoint.async ({ arguments: args }) => { try { const { criteria, type } = args; const userId = args.userId; // You might need to pass this differently let endpoint = `/marketdata/symbols/search/${encodeURIComponent(criteria)}`; if (type && type !== 'all') { endpoint += `?type=${type}`; } const symbols = await makeAuthenticatedRequest(userId, endpoint); return { content: [ { type: "text", text: JSON.stringify(symbols, null, 2) } ] }; } catch (error) { return { content: [ { type: "text", text: `Failed to search symbols: ${error.message}` } ], isError: true }; } }
- index.js:87-92 (schema)Zod schema for searchSymbols in the index.js version.const searchSymbolsSchema = z.object({ criteria: z.string().describe('Search criteria'), type: z.enum(['stock', 'option', 'future', 'forex', 'all']) .default('all') .describe('Symbol type filter') });