ig_get_positions
Retrieve all open trading positions from IG Trading MCP server for forex, indices, and commodities to monitor and manage active trades effectively.
Instructions
Get all open positions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/mcp-service.js:144-150 (schema)Tool schema definition with input schema (empty object as no parameters required) and description.
name: 'ig_get_positions', description: 'Get all open positions', inputSchema: { type: 'object', properties: {}, }, }, - src/services/mcp-service.js:590-599 (handler)MCP server tool handler that calls igService.getPositions() and returns JSON stringified response.
case 'ig_get_positions': const positions = await igService.getPositions(); return { content: [ { type: 'text', text: JSON.stringify(positions, null, 2), }, ], }; - src/services/ig-service.js:150-158 (handler)Core implementation of get positions: makes authenticated API GET request to /positions endpoint and returns the data.
async getPositions() { try { const response = await this.apiClient.get('/positions', 2); return response.data; } catch (error) { logger.error('Failed to get positions:', error.message); throw error; } }