Skip to main content
Glama
shlomico-tr

eToro MCP Server

Official
by shlomico-tr

search_instruments

Use this tool to find eToro instruments by name prefix, enabling quick autocomplete functionality for efficient instrument lookup and selection.

Instructions

Search for eToro instruments by name prefix (autocomplete)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that performs an HTTP GET request to the eToro API endpoint for instruments matching the name prefix, using the specified fields, and returns the JSON results as a markdown text content block.
    }, async (params) => {
        const { namePrefix, fields } = params;
        try {
            const fieldsString = fields.join(',');
            // This should be run server-side due to CORS limitations
            const response = await fetch(`https://www.etoro.com/sapi/instrumentsinfo/Instruments?displayname=${encodeURIComponent(namePrefix)}&fields=${fieldsString}`, {
                method: 'GET',
                headers: {
                    'accept': 'application/json, text/plain, */*',
                    'accept-language': 'en-US,en;q=0.9',
                    'cache-control': 'no-cache',
                    'pragma': 'no-cache',
                    'priority': 'u=1, i',
                    'sec-ch-ua': '"Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"',
                    'sec-ch-ua-mobile': '?0',
                    'sec-ch-ua-platform': '"Windows"',
                    'sec-fetch-dest': 'empty',
                    'sec-fetch-mode': 'cors',
                    'sec-fetch-site': 'same-origin',
                    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
                }
            });
            if (!response.ok) {
                throw new Error(`Failed to search instruments: ${response.statusText}`);
            }
            const searchResults = await response.json();
            return {
                content: [{
                        type: "text",
                        text: JSON.stringify(searchResults, null, 2)
                    }],
            };
        }
        catch (error) {
            if (error instanceof Error) {
                throw new Error(`Failed to search instruments: ${error.message}`);
            }
            throw error;
        }
  • Zod input schema defining parameters for the tool: required namePrefix (string) and optional fields (array of strings with default).
    namePrefix: z.string().describe("The prefix to search for in instrument names"),
    fields: z.array(z.string())
        .default(['internalInstrumentId', 'displayname', 'internalClosingPrice'])
        .describe("Fields to include in the response")
  • dist/index.js:183-227 (registration)
    Registration of the 'search_instruments' tool on the MCP server using server.tool(), including description, input schema, and inline handler function.
    server.tool("search_instruments", "Search for eToro instruments by name prefix (autocomplete)", {
        namePrefix: z.string().describe("The prefix to search for in instrument names"),
        fields: z.array(z.string())
            .default(['internalInstrumentId', 'displayname', 'internalClosingPrice'])
            .describe("Fields to include in the response")
    }, async (params) => {
        const { namePrefix, fields } = params;
        try {
            const fieldsString = fields.join(',');
            // This should be run server-side due to CORS limitations
            const response = await fetch(`https://www.etoro.com/sapi/instrumentsinfo/Instruments?displayname=${encodeURIComponent(namePrefix)}&fields=${fieldsString}`, {
                method: 'GET',
                headers: {
                    'accept': 'application/json, text/plain, */*',
                    'accept-language': 'en-US,en;q=0.9',
                    'cache-control': 'no-cache',
                    'pragma': 'no-cache',
                    'priority': 'u=1, i',
                    'sec-ch-ua': '"Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"',
                    'sec-ch-ua-mobile': '?0',
                    'sec-ch-ua-platform': '"Windows"',
                    'sec-fetch-dest': 'empty',
                    'sec-fetch-mode': 'cors',
                    'sec-fetch-site': 'same-origin',
                    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
                }
            });
            if (!response.ok) {
                throw new Error(`Failed to search instruments: ${response.statusText}`);
            }
            const searchResults = await response.json();
            return {
                content: [{
                        type: "text",
                        text: JSON.stringify(searchResults, null, 2)
                    }],
            };
        }
        catch (error) {
            if (error instanceof Error) {
                throw new Error(`Failed to search instruments: ${error.message}`);
            }
            throw error;
        }
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It describes the search functionality but lacks details on behavioral traits such as rate limits, authentication needs, response format, or whether it's read-only or has side effects. For a search tool with zero annotation coverage, this is insufficient.

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 front-loads the key information ('Search for eToro instruments') and adds necessary detail ('by name prefix (autocomplete)'). There is no wasted text, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It explains what the tool does but lacks behavioral context and usage guidance relative to siblings. For a search tool, this is minimally viable but could be more complete by addressing when to use it and what to expect in return.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description adds value by explaining the search method ('by name prefix (autocomplete)'), which provides context beyond the empty schema. Baseline is 4 for zero parameters, as the description compensates appropriately.

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 action ('Search for') and resource ('eToro instruments'), and specifies the search method ('by name prefix (autocomplete)'). However, it doesn't explicitly differentiate from sibling tools like 'fetch_instrument_details', which might provide more detailed information about specific instruments rather than searching.

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?

The description provides no guidance on when to use this tool versus alternatives like 'fetch_instrument_details' or 'fetch_etoro_portfolio'. It mentions the search method but doesn't specify use cases, prerequisites, or exclusions, leaving the agent to infer usage context.

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/shlomico-tr/etoroPortfolioMCP'

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