Skip to main content
Glama
mmarqueti

ActiveCampaign MCP Server

by mmarqueti

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);
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 states it searches for a contact by email but doesn't describe what happens if no contact is found (e.g., returns null, error), if it's case-sensitive, rate limits, authentication needs, or the return format. For a lookup tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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's appropriately sized for a simple lookup tool and front-loaded with the key action and resource, 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 tool's simplicity (1 parameter, 100% schema coverage) but lack of annotations and output schema, the description is incomplete. It doesn't explain what is returned (e.g., contact object, error handling) or behavioral aspects like idempotency. For a tool that interacts with an external service, more context on outcomes and constraints is needed to be fully helpful.

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 schema description coverage is 100%, with the single parameter 'email' documented as 'Email do contato a ser buscado'. The description adds no additional meaning beyond this, such as format requirements or examples. With high schema coverage, the baseline is 3, as the schema does the heavy lifting, but the description doesn't compensate with extra context.

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 ('Busca' - search) and resource ('contato no ActiveCampaign'), making the purpose understandable. It specifies the search criterion ('pelo email'), which distinguishes it from sibling tools like get_contact_by_id. However, it doesn't explicitly differentiate from search_contacts, which might also support email searches.

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 get_contact_by_id or search_contacts. It doesn't mention prerequisites, such as requiring an existing contact with that email, or exclusions, like what happens if multiple contacts share the same email. Usage is implied by the name but not explicitly stated.

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

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