ig_search_markets
Search for tradeable markets on IG Trading, including forex, indices, and commodities, using specific search terms like "Oil" or "Apple" to streamline market discovery.
Instructions
Search for tradeable markets
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| searchTerm | Yes | Search term (e.g., "Oil", "EUR/USD", "Apple") |
Input Schema (JSON Schema)
{
"properties": {
"searchTerm": {
"description": "Search term (e.g., \"Oil\", \"EUR/USD\", \"Apple\")",
"type": "string"
}
},
"required": [
"searchTerm"
],
"type": "object"
}
Implementation Reference
- src/services/ig-service.js:343-351 (handler)Core implementation of the ig_search_markets tool: calls IG API /markets endpoint with the search term and returns the results.async searchMarkets(searchTerm) { try { const response = await this.apiClient.get(`/markets?searchTerm=${encodeURIComponent(searchTerm)}`); return response.data; } catch (error) { logger.error('Market search failed:', error.message); throw error; } }
- src/services/mcp-service.js:680-689 (handler)MCP callTool handler case that invokes igService.searchMarkets and formats the response as MCP content.case 'ig_search_markets': const searchResults = await igService.searchMarkets(args.searchTerm); return { content: [ { type: 'text', text: JSON.stringify(searchResults, null, 2), }, ], };
- src/services/mcp-service.js:360-372 (schema)Tool schema definition including name, description, and input schema used for tool listing and validation.name: 'ig_search_markets', description: 'Search for tradeable markets', inputSchema: { type: 'object', properties: { searchTerm: { type: 'string', description: 'Search term (e.g., "Oil", "EUR/USD", "Apple")', }, }, required: ['searchTerm'], }, },
- src/services/mcp-service.js:506-510 (registration)Registers the listTools handler that returns the TOOLS array containing ig_search_markets.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS, }; });