Skip to main content
Glama
johnoconnor0

Google Ads MCP Server

by johnoconnor0

google_ads_add_call_extension

Add a call extension to a Google Ads campaign to display your phone number with a click-to-call button, enabling mobile users to contact you directly from the ad.

Instructions

Add call extension to a campaign.

Call extensions display your phone number with a click-to-call button, making it easy for mobile users to contact you directly from the ad.

Args: customer_id: Google Ads customer ID (10 digits, no hyphens) campaign_id: Campaign ID to add call extension phone_number: Phone number in local format (e.g., "(555) 123-4567") country_code: Two-letter country code (default: US) track_calls: Enable call conversion tracking

Returns: Call extension creation result

Example: google_ads_add_call_extension( customer_id="1234567890", campaign_id="12345678", phone_number="(555) 123-4567", country_code="US", track_calls=True )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customer_idYes
campaign_idYes
phone_numberYes
country_codeNoUS
track_callsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler function 'google_ads_add_call_extension' that receives the tool call, validates inputs, creates a CallExtensionConfig, calls the manager, and returns a formatted result string.
    def google_ads_add_call_extension(
        customer_id: str,
        campaign_id: str,
        phone_number: str,
        country_code: str = "US",
        track_calls: bool = False
    ) -> str:
        """Add call extension to a campaign.
    
        Call extensions display your phone number with a click-to-call button,
        making it easy for mobile users to contact you directly from the ad.
    
        Args:
            customer_id: Google Ads customer ID (10 digits, no hyphens)
            campaign_id: Campaign ID to add call extension
            phone_number: Phone number in local format (e.g., "(555) 123-4567")
            country_code: Two-letter country code (default: US)
            track_calls: Enable call conversion tracking
    
        Returns:
            Call extension creation result
    
        Example:
            google_ads_add_call_extension(
                customer_id="1234567890",
                campaign_id="12345678",
                phone_number="(555) 123-4567",
                country_code="US",
                track_calls=True
            )
        """
        with performance_logger.track_operation('add_call_extension', customer_id=customer_id):
            try:
                client = get_auth_manager().get_client()
                extensions_manager = ExtensionsManager(client)
    
                config = CallExtensionConfig(
                    phone_number=phone_number,
                    country_code=country_code,
                    call_conversion_reporting_state=(
                        CallConversionReportingState.USE_ACCOUNT_LEVEL_CALL_CONVERSION_ACTION
                        if track_calls else CallConversionReportingState.DISABLED
                    )
                )
    
                result = extensions_manager.add_call_extension(
                    customer_id=customer_id,
                    campaign_id=campaign_id,
                    config=config
                )
    
                audit_logger.log_api_call(
                    customer_id=customer_id,
                    operation='add_call_extension',
                    campaign_id=campaign_id,
                    status='success'
                )
    
                output = f"# 📞 Call Extension Added\n\n"
                output += f"**Campaign ID**: {result['campaign_id']}\n"
                output += f"**Phone Number**: {result['phone_number']}\n"
                output += f"**Country Code**: {result['country_code']}\n"
                output += f"**Call Tracking**: {'Enabled' if track_calls else 'Disabled'}\n\n"
    
                output += "## What Are Call Extensions?\n\n"
                output += "Call extensions add a phone number to your ads with a clickable\n"
                output += "call button on mobile devices. Users can call you directly from\n"
                output += "search results without visiting your website.\n\n"
    
                output += "## Benefits\n\n"
                output += "✅ **Mobile Optimization** - One-tap calling on smartphones\n"
                output += "✅ **Higher Conversion Rates** - Direct contact = faster sales\n"
                output += "✅ **Call Tracking** - Measure calls as conversions\n"
                output += "✅ **Local Businesses** - Essential for location-based services\n\n"
    
                if track_calls:
                    output += "📊 **Call Tracking Enabled**: Calls will be tracked as conversions\n\n"
    
                output += "💡 **Best Practices**:\n"
                output += "- Set business hours scheduling\n"
                output += "- Use a dedicated tracking number\n"
                output += "- Enable call reporting to measure ROI\n"
                output += "- Ensure staff is ready to handle calls\n"
    
                return output
    
            except Exception as e:
                error_msg = ErrorHandler.handle_error(e, context="add_call_extension")
                return f"❌ Failed to add call extension: {error_msg}"
  • The 'register_extension_tools(mcp)' function that registers the tool decorator (@mcp.tool()) on the handler function.
    def register_extension_tools(mcp):
  • The CallExtensionConfig dataclass defining the schema for call extension configuration (phone_number, country_code, call_conversion_reporting_state).
    @dataclass
    class CallExtensionConfig:
        """Configuration for call extension."""
        phone_number: str
        country_code: str = "US"
        call_conversion_reporting_state: CallConversionReportingState = CallConversionReportingState.DISABLED
  • The CallConversionReportingState enum defining possible call conversion reporting states (DISABLED, USE_ACCOUNT_LEVEL_CALL_CONVERSION_ACTION, USE_RESOURCE_LEVEL_CALL_CONVERSION_ACTION).
    class CallConversionReportingState(str, Enum):
        """Call conversion reporting states."""
        DISABLED = "DISABLED"
        USE_ACCOUNT_LEVEL_CALL_CONVERSION_ACTION = "USE_ACCOUNT_LEVEL_CALL_CONVERSION_ACTION"
        USE_RESOURCE_LEVEL_CALL_CONVERSION_ACTION = "USE_RESOURCE_LEVEL_CALL_CONVERSION_ACTION"
  • The ExtensionsManager.add_call_extension() method that performs the actual Google Ads API calls to create the call asset and link it to the campaign.
    def add_call_extension(
        self,
        customer_id: str,
        campaign_id: str,
        config: CallExtensionConfig
    ) -> Dict[str, Any]:
        """Add call extension to a campaign.
    
        Args:
            customer_id: Customer ID (without hyphens)
            campaign_id: Campaign ID
            config: Call extension configuration
    
        Returns:
            Created call extension details
        """
        asset_service = self.client.get_service("AssetService")
        campaign_asset_service = self.client.get_service("CampaignAssetService")
    
        # Create call asset
        asset_operation = self.client.get_type("AssetOperation")
        asset = asset_operation.create
    
        asset.type_ = self.client.enums.AssetTypeEnum.CALL
        asset.call_asset.phone_number = config.phone_number
        asset.call_asset.country_code = config.country_code
        asset.call_asset.call_conversion_reporting_state = (
            self.client.enums.CallConversionReportingStateEnum[config.call_conversion_reporting_state.value]
        )
    
        # Create asset
        asset_response = asset_service.mutate_assets(
            customer_id=customer_id,
            operations=[asset_operation]
        )
        asset_resource_name = asset_response.results[0].resource_name
    
        # Link asset to campaign
        campaign_asset_operation = self.client.get_type("CampaignAssetOperation")
        campaign_asset = campaign_asset_operation.create
    
        campaign_asset.asset = asset_resource_name
        campaign_asset.campaign = self.client.get_service("CampaignService").campaign_path(
            customer_id, campaign_id
        )
        campaign_asset.field_type = self.client.enums.AssetFieldTypeEnum.CALL
    
        campaign_asset_service.mutate_campaign_assets(
            customer_id=customer_id,
            operations=[campaign_asset_operation]
        )
    
        return {
            'campaign_id': campaign_id,
            'phone_number': config.phone_number,
            'country_code': config.country_code,
            'asset_resource_name': asset_resource_name
        }
Behavior2/5

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

With no annotations, the description should reveal behavioral traits like idempotency, side effects, or error handling. It only states it 'adds' and returns a result, leaving agent unaware of behavior if extension already exists or if there are limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is well-structured with separate sections for purpose, parameters, returns, and an example. No unnecessary repetition, but minor redundancy in explaining call extension purpose in first paragraph could be tightened.

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

Completeness3/5

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

Covers purpose, parameters, and return, but lacks usage guidelines and behavioral transparency. For a tool with no annotations and 5 parameters, additional context about idempotency or preconditions would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but description compensates with detailed parameter explanations: customer_id format, campaign_id numeric, phone number format, country_code default, and track_calls boolean. This adds significant value beyond schema titles and types.

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?

Description clearly states 'Add call extension to a campaign' and explains its function. While the name and first sentence differentiate it from sibling extension tools (e.g., add_callout_extension), it does not explicitly distinguish itself from other 'add' operations.

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?

No guidance on when to use this tool versus other extension tools or prerequisites (e.g., campaign must exist). The example is provided but lacks conditional context or alternatives.

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/johnoconnor0/google-ads-mcp'

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