Skip to main content
Glama

get_contact_by_email

Retrieve contact details from ActiveCampaign using an email address. This tool integrates with the ActiveCampaign MCP Server to simplify contact lookup and management.

Instructions

Busca um contato no ActiveCampaign pelo email

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesEmail do contato a ser buscado

Implementation Reference

  • Core handler function that performs the API request to ActiveCampaign to retrieve contact by email, handles empty results and errors, formats the contact data, and returns the response in MCP tool format.
    private async getContactByEmail(email: string) { try { const response = await this.apiClient.get('/api/3/contacts', { params: { email: email, include: 'fieldValues,tags,contactLists', }, }); const contacts = response.data.contacts; if (!contacts || contacts.length === 0) { return { content: [ { type: 'text', text: `Nenhum contato encontrado com o email: ${email}`, }, ], }; } const contact = await this.formatContactData(contacts[0]); return { content: [ { type: 'text', text: JSON.stringify(contact, null, 2), }, ], }; } catch (error) { throw new Error(`Erro ao buscar contato por email: ${error instanceof Error ? error.message : 'Erro desconhecido'}`); } }
  • Defines the tool metadata: name, description, and input schema requiring an 'email' string parameter.
    { name: 'get_contact_by_email', description: 'Busca um contato no ActiveCampaign pelo email', inputSchema: { type: 'object', properties: { email: { type: 'string', description: 'Email do contato a ser buscado', }, }, required: ['email'], }, },
  • src/index.ts:47-54 (registration)
    Registers the get_contact_by_email tool (via contactTools.getTools()) in the MCP server's listTools request handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { const contactTools = this.contactTools.getTools(); const trackingTools = this.trackingTools.getTools(); return { tools: [...contactTools, ...trackingTools] as Tool[], }; });
  • src/index.ts:62-65 (registration)
    Routes calls to 'get_contact_by_email' to the ContactTools.executeTool method in the MCP server's callTool request handler.
    const contactToolNames = ['get_contact_by_email', 'get_contact_by_id', 'search_contacts']; if (contactToolNames.includes(name)) { return await this.contactTools.executeTool(name, args); }
  • Internal dispatch in ContactTools.executeTool that invokes the getContactByEmail handler.
    case 'get_contact_by_email': return await this.getContactByEmail(args?.email as string);

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/mmarqueti/activecampaign-mcp-server'

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