Skip to main content
Glama
kea0811
by kea0811

ig_get_watchlist

Retrieve detailed information about a specific trading watchlist using the IG Trading API. Ideal for managing and analyzing forex, indices, and commodities data within the IG Trading MCP server.

Instructions

Get details of a specific watchlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
watchlistIdYesWatchlist ID

Implementation Reference

  • Tool registration in TOOLS array, including name, description, and input schema requiring watchlistId.
      name: 'ig_get_watchlist',
      description: 'Get details of a specific watchlist',
      inputSchema: {
        type: 'object',
        properties: {
          watchlistId: {
            type: 'string',
            description: 'Watchlist ID',
          },
        },
        required: ['watchlistId'],
      },
    },
  • MCP server request handler for ig_get_watchlist tool, delegates to IGService.getWatchlist and returns JSON response.
    case 'ig_get_watchlist':
      const watchlist = await igService.getWatchlist(args.watchlistId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(watchlist, null, 2),
          },
        ],
      };
  • Core implementation of getWatchlist method in IGService class, performs API call to fetch specific watchlist data.
    async getWatchlist(watchlistId) {
      try {
        const response = await this.apiClient.get(`/watchlists/${watchlistId}`);
        return response.data;
      } catch (error) {
        logger.error(`Failed to get watchlist ${watchlistId}:`, error.message);
        throw error;
      }
    }

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