Skip to main content
Glama
Meerkats-Ai

Icypeas MCP Server

by Meerkats-Ai

icypeas_find_work_email

Retrieve professional email addresses by entering a person's first name, last name, and company or domain information. Simplify contact discovery with precision.

Instructions

Find a work email using name and company information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainOrCompanyYesThe domain or company name
firstnameYesThe first name of the person
lastnameYesThe last name of the person

Implementation Reference

  • Main execution logic for the 'icypeas_find_work_email' tool. Validates input using isFindWorkEmailParams, initiates API search via '/email-search', polls results using pollForEmailSearchResults, formats response with emails and person details.
    case 'icypeas_find_work_email': {
      if (!isFindWorkEmailParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for icypeas_find_work_email'
        );
      }
    
      try {
        const payload = {
          firstname: args.firstname,
          lastname: args.lastname,
          domainOrCompany: args.domainOrCompany
        };
    
        // Step 1: Initiate the email search
        safeLog('info', 'Initiating email search with payload: ' + JSON.stringify(payload));
        const searchResponse = await withRetry<{data: EmailSearchResponse}>(
          async () => apiClient.post('/email-search', payload),
          'initiate email search'
        );
    
        if (!searchResponse.data.success || !searchResponse.data.item._id) {
          throw new Error('Failed to initiate email search: ' + JSON.stringify(searchResponse.data));
        }
    
        const searchId = searchResponse.data.item._id;
        safeLog('info', `Email search initiated with ID: ${searchId}`);
    
        // Step 2: Poll for results
        safeLog('info', `Initiating polling for results with search ID: ${searchId}`);
        const searchResult = await pollForEmailSearchResults(
          searchId,
          10,    // Max 10 attempts
          3000,  // 3 seconds between polls
          5000   // 5 seconds initial delay
        );
    
        // Format the response
        let formattedResponse;
        
        if (
          searchResult.success && 
          searchResult.items.length > 0 && 
          searchResult.items[0].results && 
          searchResult.items[0].results.emails && 
          searchResult.items[0].results.emails.length > 0
        ) {
          // Success case with emails found
          formattedResponse = {
            success: true,
            person: {
              firstname: searchResult.items[0].results.firstname,
              lastname: searchResult.items[0].results.lastname,
              fullname: searchResult.items[0].results.fullname,
              gender: searchResult.items[0].results.gender
            },
            emails: searchResult.items[0].results.emails.map(email => ({
              email: email.email,
              certainty: email.certainty,
              provider: email.mxProvider
            })),
            status: searchResult.items[0].status
          };
        } else if (searchResult.items.length > 0) {
          // Search completed but no emails found
          formattedResponse = {
            success: true,
            person: {
              firstname: args.firstname,
              lastname: args.lastname,
              fullname: `${args.firstname} ${args.lastname}`
            },
            emails: [],
            status: searchResult.items[0].status,
            message: "No emails found or search still in progress"
          };
        } else {
          // Something went wrong
          formattedResponse = {
            success: false,
            message: "Failed to retrieve email search results",
            rawResponse: searchResult
          };
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(formattedResponse, null, 2),
            },
          ],
          isError: false,
        };
      } catch (error) {
        const errorMessage = axios.isAxiosError(error)
          ? `API Error: ${error.response?.data?.message || error.message}`
          : `Error: ${error instanceof Error ? error.message : String(error)}`;
    
        return {
          content: [{ type: 'text', text: errorMessage }],
          isError: true,
        };
      }
    }
  • Tool schema definition including name, description, and inputSchema with required properties: firstname, lastname, domainOrCompany.
    const FIND_WORK_EMAIL_TOOL: Tool = {
      name: 'icypeas_find_work_email',
      description: 'Find a work email using name and company information.',
      inputSchema: {
        type: 'object',
        properties: {
          firstname: {
            type: 'string',
            description: 'The first name of the person',
          },
          lastname: {
            type: 'string',
            description: 'The last name of the person',
          },
          domainOrCompany: {
            type: 'string',
            description: 'The domain or company name',
          }
        },
        required: ['firstname', 'lastname', 'domainOrCompany'],
      },
    };
  • src/index.ts:259-263 (registration)
    Registration of the tool in the MCP server's listTools handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        FIND_WORK_EMAIL_TOOL,
      ],
    }));
  • Type guard function to validate input parameters for the tool handler.
    function isFindWorkEmailParams(args: unknown): args is FindWorkEmailParams {
      if (
        typeof args !== 'object' ||
        args === null ||
        !('firstname' in args) ||
        typeof (args as { firstname: unknown }).firstname !== 'string' ||
        !('lastname' in args) ||
        typeof (args as { lastname: unknown }).lastname !== 'string' ||
        !('domainOrCompany' in args) ||
        typeof (args as { domainOrCompany: unknown }).domainOrCompany !== 'string'
      ) {
        return false;
      }
    
      return true;
    }
  • Polling helper function to wait for email search results from the API.
    async function pollForEmailSearchResults(
      searchId: string,
      maxAttempts = 10,
      intervalMs = 3000,
      initialDelayMs = 5000
    ): Promise<EmailSearchResult> {
      // Initial delay before first poll
      safeLog('info', `Waiting initial delay of ${initialDelayMs}ms before polling`);
      await delay(initialDelayMs);
      
      let attempts = 0;
      
      while (attempts < maxAttempts) {
        attempts++;
        safeLog('info', `Polling attempt ${attempts}/${maxAttempts}`);
        
        const response = await apiClient.post<EmailSearchResult>(
          '/bulk-single-searchs/read',
          { id: searchId }
        );
        
        // Check if search is complete
        if (
          response.data.success &&
          response.data.items.length > 0 &&
          !['NONE', 'SCHEDULED', 'IN_PROGRESS'].includes(response.data.items[0].status)
        ) {
          return response.data;
        }
        
        // If we've reached max attempts, return the current result
        if (attempts >= maxAttempts) {
          return response.data;
        }
        
        // Wait before trying again
        await delay(intervalMs);
      }
      
      throw new Error('Max polling attempts reached');
    }
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 of behavioral disclosure. It mentions 'Find a work email' but doesn't explain how it works (e.g., search method, data sources), success rates, error handling, or privacy considerations. This leaves significant gaps in understanding the tool's behavior and reliability.

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 unnecessary words. It is front-loaded and easy to parse, making it highly concise and well-structured for quick understanding.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., email format, confidence scores) or behavioral aspects like rate limits or data sources. For a tool that likely involves external data lookups, more context is needed to use it effectively.

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 all three required parameters. The description adds minimal value beyond the schema by implying the parameters are used together to find an email, but it doesn't provide additional context like format examples or usage tips. This meets the baseline for high schema coverage.

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 tool's purpose: 'Find a work email using name and company information.' It specifies the verb ('Find'), resource ('work email'), and required inputs, making it easy to understand what the tool does. However, since there are no sibling tools, it cannot distinguish from alternatives, which prevents a perfect score.

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, prerequisites, or limitations. It simply states what the tool does without context about its applicability, such as when it's most effective or any constraints on the data it can handle.

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/Meerkats-Ai/icypeas-mcp-server'

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