Skip to main content
Glama

ig_get_client_sentiment

Analyzes client sentiment for specific markets using market IDs to inform trading decisions, integrated with the IG Trading API for forex, indices, and commodities.

Instructions

Get client sentiment for markets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketIdsYesList of market IDs

Implementation Reference

  • Core implementation of the tool: fetches client sentiment data from IG API endpoint /clientsentiment using the provided marketIds.
    async getClientSentiment(marketIds) { if (!Array.isArray(marketIds)) { marketIds = [marketIds]; } try { const marketIdString = marketIds.join(','); const response = await this.apiClient.get(`/clientsentiment?marketIds=${encodeURIComponent(marketIdString)}`); return response.data; } catch (error) { logger.error('Failed to get client sentiment:', error.message); throw error; } }
  • MCP server handler for the tool: calls igService.getClientSentiment and formats response as MCP content.
    case 'ig_get_client_sentiment': const sentiment = await igService.getClientSentiment(args.marketIds); return { content: [ { type: 'text', text: JSON.stringify(sentiment, null, 2), }, ], };
  • Tool schema definition including input validation for marketIds array.
    { name: 'ig_get_client_sentiment', description: 'Get client sentiment for markets', inputSchema: { type: 'object', properties: { marketIds: { type: 'array', items: { type: 'string', }, description: 'List of market IDs', }, }, required: ['marketIds'], }, },
  • Registration of tool list handler which returns the TOOLS array containing 'ig_get_client_sentiment'.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS, }; });

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