Skip to main content
Glama
kea0811
by kea0811

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

TableJSON Schema
NameRequiredDescriptionDefault
epicsNoInitial epics to add
nameYesWatchlist name

Implementation Reference

  • 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;
      }
    }
  • 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),
          },
        ],
      };
  • 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'],
      },
    },
  • 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'],
    },

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/kea0811/ig-trading-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server