Skip to main content
Glama
bcharleson

Instantly MCP Server

get_lead

Read-only

Retrieve comprehensive lead details including contact information, campaign membership, sequence status, and custom variables by providing the lead ID.

Instructions

Get lead details by ID.

Returns comprehensive lead information including:

  • Contact details (email, name, company, phone)

  • Custom variables

  • Campaign/list membership

  • Sequence status and history

  • Interest status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_lead' tool. Fetches lead details by ID from the Instantly API and returns JSON.
    async def get_lead(params: GetLeadInput) -> str:
        """
        Get lead details by ID.
        
        Returns comprehensive lead information including:
        - Contact details (email, name, company, phone)
        - Custom variables
        - Campaign/list membership
        - Sequence status and history
        - Interest status
        """
        client = get_client()
        result = await client.get(f"/leads/{params.lead_id}")
        return json.dumps(result, indent=2)
  • Pydantic input schema for the get_lead tool, requiring a lead_id.
    class GetLeadInput(BaseModel):
        """Input for getting lead details."""
        
        model_config = ConfigDict(str_strip_whitespace=True, extra="ignore")
        
        lead_id: str = Field(..., description="Lead UUID")
  • Global registration of all tools including get_lead with FastMCP, including specific readOnlyHint annotation.
    def register_tools():
        """Register all tools with MCP annotations."""
        
        # Import tool modules dynamically based on categories
        tools = get_all_tools()
        
        # Tool annotations mapping
        # readOnlyHint: Tool only reads data
        # destructiveHint: Tool modifies/deletes data
        # confirmationRequiredHint: Requires user confirmation
        TOOL_ANNOTATIONS = {
            # Account tools
            "list_accounts": {"readOnlyHint": True},
            "get_account": {"readOnlyHint": True},
            "create_account": {"destructiveHint": False},
            "update_account": {"destructiveHint": False},
            "manage_account_state": {"destructiveHint": False},
            "delete_account": {"destructiveHint": True, "confirmationRequiredHint": True},
    
            # Campaign tools
            "create_campaign": {"destructiveHint": False},
            "list_campaigns": {"readOnlyHint": True},
            "get_campaign": {"readOnlyHint": True},
            "update_campaign": {"destructiveHint": False},
            "activate_campaign": {"destructiveHint": False},
            "pause_campaign": {"destructiveHint": False},
            "delete_campaign": {"destructiveHint": True, "confirmationRequiredHint": True},
            "search_campaigns_by_contact": {"readOnlyHint": True},
    
            # Lead tools
            "list_leads": {"readOnlyHint": True},
            "get_lead": {"readOnlyHint": True},
            "create_lead": {"destructiveHint": False},
            "update_lead": {"destructiveHint": False},
            "list_lead_lists": {"readOnlyHint": True},
            "create_lead_list": {"destructiveHint": False},
            "update_lead_list": {"destructiveHint": False},
            "get_verification_stats_for_lead_list": {"readOnlyHint": True},
            "add_leads_to_campaign_or_list_bulk": {"destructiveHint": False},
            "delete_lead": {"destructiveHint": True, "confirmationRequiredHint": True},
            "delete_lead_list": {"destructiveHint": True, "confirmationRequiredHint": True},
            "move_leads_to_campaign_or_list": {"destructiveHint": False},
    
            # Email tools
            "list_emails": {"readOnlyHint": True},
            "get_email": {"readOnlyHint": True},
            "reply_to_email": {"destructiveHint": True, "confirmationRequiredHint": True},
            "count_unread_emails": {"readOnlyHint": True},
            "verify_email": {"readOnlyHint": True},
            "mark_thread_as_read": {"destructiveHint": False},
    
            # Analytics tools
            "get_campaign_analytics": {"readOnlyHint": True},
            "get_daily_campaign_analytics": {"readOnlyHint": True},
            "get_warmup_analytics": {"readOnlyHint": True},
    
            # Background job tools
            "list_background_jobs": {"readOnlyHint": True},
            "get_background_job": {"readOnlyHint": True},
        }
        
        for tool_func in tools:
            tool_name = tool_func.__name__
            annotations = TOOL_ANNOTATIONS.get(tool_name, {})
            
            # Register tool with FastMCP
            mcp.tool(
                name=tool_name,
                annotations=annotations,
            )(tool_func)
        
        print(f"[Instantly MCP] ✅ Registered {len(tools)} tools", file=sys.stderr)
  • Local collection of lead tools including get_lead for use in get_all_tools() registration.
    LEAD_TOOLS = [
        list_leads,
        get_lead,
        create_lead,
        update_lead,
        list_lead_lists,
        create_lead_list,
        update_lead_list,
        get_verification_stats_for_lead_list,
        add_leads_to_campaign_or_list_bulk,
        delete_lead,
        delete_lead_list,
        move_leads_to_campaign_or_list,
    ]
Behavior3/5

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

The description adds value beyond the 'readOnlyHint: true' annotation by detailing the comprehensive information returned (e.g., contact details, custom variables, sequence status). However, it doesn't disclose other behavioral traits like error handling, rate limits, or authentication needs, which are important for a read operation but not covered by 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: the first sentence states the core purpose, followed by a bulleted list of return details. Every sentence earns its place by adding clarity without redundancy, making it efficient and easy to parse for an AI agent.

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

Completeness4/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), annotations covering read-only safety, and the presence of an output schema (implied by 'Has output schema: true'), the description is reasonably complete. It explains what the tool does and what information it returns, though it could benefit from more usage context or error details to be fully comprehensive.

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?

With 0% schema description coverage, the schema only documents 'lead_id' as a 'Lead UUID' without further context. The description doesn't add any parameter-specific semantics, such as format examples or validation rules. Since the schema provides basic info, the baseline score of 3 is appropriate, but the description fails to compensate for the low 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: 'Get lead details by ID' specifies the verb ('Get') and resource ('lead details'), making it distinct from siblings like 'list_leads' or 'update_lead'. However, it doesn't explicitly differentiate from 'get_account' or 'get_campaign', which follow a similar pattern, leaving some ambiguity in sibling context.

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. It doesn't mention prerequisites (e.g., needing a lead ID), exclusions, or comparisons to siblings like 'list_leads' for browsing or 'search_campaigns_by_contact' for finding leads. This lack of context could lead to misuse in complex scenarios.

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