ig_create_watchlist
Create a custom watchlist on IG Trading by specifying a name and adding initial market instruments (epics) for tracking forex, indices, and commodities.
Instructions
Create a new watchlist
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| epics | No | Initial epics to add | |
| name | Yes | Watchlist name |
Input Schema (JSON Schema)
{
"properties": {
"epics": {
"default": [],
"description": "Initial epics to add",
"items": {
"type": "string"
},
"type": "array"
},
"name": {
"description": "Watchlist name",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/services/ig-service.js:445-453 (handler)Core handler function in IGService that creates a watchlist by posting to the IG API /watchlists endpoint with the provided name and initial epics.async createWatchlist(name, epics = []) { try { const response = await this.apiClient.post('/watchlists', { name, epics }); return response.data; } catch (error) { logger.error('Failed to create watchlist:', error.message); throw error; } }
- src/services/mcp-service.js:755-764 (handler)MCP tool handler in the switch statement that invokes the IGService.createWatchlist method with parsed arguments and formats the response as MCP content.case 'ig_create_watchlist': const newWatchlist = await igService.createWatchlist(args.name, args.epics || []); return { content: [ { type: 'text', text: JSON.stringify(newWatchlist, null, 2), }, ], };
- src/services/mcp-service.js:463-484 (registration)Tool registration in the TOOLS array, including name, description, and input schema for listing in MCP tool discovery.{ name: 'ig_create_watchlist', description: 'Create a new watchlist', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Watchlist name', }, epics: { type: 'array', items: { type: 'string', }, description: 'Initial epics to add', default: [], }, }, required: ['name'], }, },
- src/services/mcp-service.js:466-483 (schema)Input schema definition for the ig_create_watchlist tool, specifying parameters name (required string) and epics (optional array of strings).inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Watchlist name', }, epics: { type: 'array', items: { type: 'string', }, description: 'Initial epics to add', default: [], }, }, required: ['name'], },