Skip to main content
Glama
kea0811
by kea0811

ig_get_market_details

Retrieve comprehensive market data for specific instruments by inputting market epic codes. Use this to analyze forex, indices, and commodities for informed trading decisions.

Instructions

Get detailed information about a market

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
epicsYesList of market epic codes (max 50)

Implementation Reference

  • Core handler function that fetches market details from IG API for the given list of epics (up to 50), handles array normalization and error logging.
    async getMarketDetails(epics) {
      if (!Array.isArray(epics)) {
        epics = [epics];
      }
    
      if (epics.length > 50) {
        throw new Error('Maximum 50 epics allowed per request');
      }
    
      try {
        const epicString = epics.join(',');
        const response = await this.apiClient.get(`/markets?epics=${encodeURIComponent(epicString)}`);
        return response.data;
      } catch (error) {
        logger.error('Failed to get market details:', error.message);
        throw error;
      }
    }
  • MCP tool execution handler that delegates to IGService.getMarketDetails and formats response as MCP content.
    case 'ig_get_market_details':
      const marketDetails = await igService.getMarketDetails(args.epics);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(marketDetails, null, 2),
          },
        ],
      };
  • Tool schema definition including name, description, and input schema for epics array, used for tool listing and validation.
    {
      name: 'ig_get_market_details',
      description: 'Get detailed information about a market',
      inputSchema: {
        type: 'object',
        properties: {
          epics: {
            type: 'array',
            items: {
              type: 'string',
            },
            description: 'List of market epic codes (max 50)',
          },
        },
        required: ['epics'],
      },
    },
  • Registers the list tools handler that returns the TOOLS array containing the ig_get_market_details tool definition.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: TOOLS,
      };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden but only states the action without disclosing behavioral traits. It doesn't mention if this is a read-only operation, rate limits, authentication needs, error handling, or what 'detailed information' entails, which is insufficient for a tool with no structured safety hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of financial market tools and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, potential return formats, or any prerequisites, leaving significant gaps for the agent to infer behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the 'epics' parameter as a list of market epic codes with a max of 50. The description adds no additional meaning beyond this, so it meets the baseline of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'detailed information about a market', which is specific and understandable. However, it doesn't differentiate from sibling tools like 'ig_search_markets' or 'ig_get_client_sentiment', which might also retrieve market-related data, so it lacks sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't specify if this is for real-time data, basic details, or how it differs from 'ig_search_markets' or 'ig_get_historical_prices', leaving the agent with no context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related 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