Skip to main content
Glama
bcharleson

Instantly MCP Server

search_campaigns_by_contact

Read-only

Find all email outreach campaigns a specific contact is enrolled in to check for existing participation, identify duplicate enrollments, and audit campaign membership.

Instructions

Find all campaigns that a specific contact/lead is part of.

Useful for:

  • Checking if a lead is already in any campaigns

  • Finding duplicate enrollments

  • Auditing lead campaign membership

Returns list of campaigns the contact email is enrolled in.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function that executes the tool: queries Instantly API endpoint /campaigns/search-by-contact with contact_email and returns JSON results.
    async def search_campaigns_by_contact(params: SearchCampaignsByContactInput) -> str:
        """
        Find all campaigns that a specific contact/lead is part of.
    
        Useful for:
        - Checking if a lead is already in any campaigns
        - Finding duplicate enrollments
        - Auditing lead campaign membership
    
        Returns list of campaigns the contact email is enrolled in.
        """
        client = get_client()
    
        query_params = {"contact_email": params.contact_email}
    
        result = await client.get("/campaigns/search-by-contact", params=query_params)
        return json.dumps(result, indent=2)
  • Pydantic input schema defining the required contact_email parameter with validation and description.
    class SearchCampaignsByContactInput(BaseModel):
        """
        Input for searching campaigns by contact email.
    
        Finds all campaigns a specific lead/contact is enrolled in.
        """
    
        model_config = ConfigDict(str_strip_whitespace=True, extra="ignore")
    
        contact_email: str = Field(..., description="Email address of the contact to search for")
  • Registration: Tool function added to CAMPAIGN_TOOLS list, which is used by get_all_tools() for server registration.
    # Export all campaign tools
    CAMPAIGN_TOOLS = [
        create_campaign,
        list_campaigns,
        get_campaign,
        update_campaign,
        activate_campaign,
        pause_campaign,
        delete_campaign,
        search_campaigns_by_contact,
    ]
  • MCP annotation registration: Specifies readOnlyHint=True for the tool in TOOL_ANNOTATIONS dict used during mcp.tool() calls.
    "search_campaigns_by_contact": {"readOnlyHint": True},
Behavior4/5

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

Annotations declare readOnlyHint=true, and the description aligns by describing a search/retrieval operation ('Find', 'Returns list'). It adds valuable behavioral context beyond annotations by specifying the return format ('list of campaigns the contact email is enrolled in') and clarifying the search scope (enrolled campaigns only). No contradiction with annotations.

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 well-structured and front-loaded with the core purpose, followed by a bulleted list of use cases and a clear statement about return values. Every sentence adds value without redundancy, making it efficient and easy to parse.

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

Completeness5/5

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

Given the tool's low complexity (1 parameter), rich annotations (readOnlyHint), and existence of an output schema, the description is complete. It covers purpose, usage scenarios, and return behavior, leaving no significant gaps for agent understanding.

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?

Schema description coverage is 0%, but the input schema's $defs includes a detailed description that explains the parameter's purpose ('Finds all campaigns a specific lead/contact is enrolled in') and format ('Email address'). The tool description does not add further parameter details, so it meets the baseline for adequate coverage without enhancing semantics.

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

Purpose5/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 with specific verb ('Find') and resource ('campaigns'), and distinguishes it from siblings by focusing on contact-based search rather than general listing or management. It explicitly identifies the target (campaigns a specific contact is part of), making the scope unambiguous.

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

Usage Guidelines4/5

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

The description provides clear usage context through a 'Useful for' section with three specific scenarios (checking existing campaigns, finding duplicates, auditing membership). However, it does not explicitly state when NOT to use this tool or name alternative tools (like list_campaigns for broader searches), which prevents a perfect score.

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

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/bcharleson/instantly-mcp-python'

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