google_ads_update_conversion_action
Update default conversion value and status for a conversion action in Google Ads to improve tracking accuracy.
Instructions
Update conversion action settings.
Args: customer_id: Customer ID (without hyphens) conversion_action_id: Conversion action ID to update conversion_value: New default value status: New status (ENABLED, PAUSED, REMOVED)
Returns: Success message
Example: google_ads_update_conversion_action( customer_id="1234567890", conversion_action_id="12345", conversion_value=75.00, status="ENABLED" )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer_id | Yes | ||
| conversion_action_id | Yes | ||
| conversion_value | No | ||
| status | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- tools/conversions/mcp_tools_conversions.py:679-755 (registration)The MCP tool decorator registration of google_ads_update_conversion_action, which is registered as an @mcp.tool() inside the register_conversion_tools function.
@mcp.tool() def google_ads_update_conversion_action( customer_id: str, conversion_action_id: str, conversion_value: Optional[float] = None, status: Optional[str] = None ) -> str: """ Update conversion action settings. Args: customer_id: Customer ID (without hyphens) conversion_action_id: Conversion action ID to update conversion_value: New default value status: New status (ENABLED, PAUSED, REMOVED) Returns: Success message Example: google_ads_update_conversion_action( customer_id="1234567890", conversion_action_id="12345", conversion_value=75.00, status="ENABLED" ) """ with performance_logger.track_operation('update_conversion_action', customer_id=customer_id): try: client = get_auth_manager().get_client() conversion_action_service = client.get_service("ConversionActionService") conversion_action_operation = client.get_type("ConversionActionOperation") conversion_action = conversion_action_operation.update conversion_action.resource_name = conversion_action_service.conversion_action_path( customer_id, conversion_action_id ) field_paths = [] if conversion_value is not None: conversion_action.value_settings.default_value = conversion_value field_paths.append("value_settings.default_value") if status: conversion_action.status = client.enums.ConversionActionStatusEnum[status.upper()] field_paths.append("status") if not field_paths: return "❌ No updates specified. Provide conversion_value or status." client.copy_from( conversion_action_operation.update_mask, field_mask_pb2.FieldMask(paths=field_paths) ) conversion_action_service.mutate_conversion_actions( customer_id=customer_id, operations=[conversion_action_operation] ) # Audit log audit_logger.log_api_call( customer_id=customer_id, operation="update_conversion_action", resource_type="conversion_action", resource_id=conversion_action_id, action="update", result="success", details={'fields': field_paths} ) return f"✅ Conversion action updated successfully!\n\nUpdated fields: {', '.join(field_paths)}" except Exception as e: error_msg = ErrorHandler.handle_error(e, context="update_conversion_action") return f"❌ Failed to update conversion action: {error_msg}" - The handler function that executes the update conversion action logic. It uses the Google Ads API (ConversionActionService) to update a conversion action's default value and/or status via a field mask-based mutation.
def google_ads_update_conversion_action( customer_id: str, conversion_action_id: str, conversion_value: Optional[float] = None, status: Optional[str] = None ) -> str: """ Update conversion action settings. Args: customer_id: Customer ID (without hyphens) conversion_action_id: Conversion action ID to update conversion_value: New default value status: New status (ENABLED, PAUSED, REMOVED) Returns: Success message Example: google_ads_update_conversion_action( customer_id="1234567890", conversion_action_id="12345", conversion_value=75.00, status="ENABLED" ) """ with performance_logger.track_operation('update_conversion_action', customer_id=customer_id): try: client = get_auth_manager().get_client() conversion_action_service = client.get_service("ConversionActionService") conversion_action_operation = client.get_type("ConversionActionOperation") conversion_action = conversion_action_operation.update conversion_action.resource_name = conversion_action_service.conversion_action_path( customer_id, conversion_action_id ) field_paths = [] if conversion_value is not None: conversion_action.value_settings.default_value = conversion_value field_paths.append("value_settings.default_value") if status: conversion_action.status = client.enums.ConversionActionStatusEnum[status.upper()] field_paths.append("status") if not field_paths: return "❌ No updates specified. Provide conversion_value or status." client.copy_from( conversion_action_operation.update_mask, field_mask_pb2.FieldMask(paths=field_paths) ) conversion_action_service.mutate_conversion_actions( customer_id=customer_id, operations=[conversion_action_operation] ) # Audit log audit_logger.log_api_call( customer_id=customer_id, operation="update_conversion_action", resource_type="conversion_action", resource_id=conversion_action_id, action="update", result="success", details={'fields': field_paths} ) return f"✅ Conversion action updated successfully!\n\nUpdated fields: {', '.join(field_paths)}" except Exception as e: error_msg = ErrorHandler.handle_error(e, context="update_conversion_action") return f"❌ Failed to update conversion action: {error_msg}" - The input schema/type signature for the tool: customer_id (str), conversion_action_id (str), optional conversion_value (float), optional status (str - ENABLED/PAUSED/REMOVED).
def google_ads_update_conversion_action( customer_id: str, conversion_action_id: str, conversion_value: Optional[float] = None, status: Optional[str] = None ) -> str: - google_ads_mcp.py:480-514 (registration)The main MCP server registration - register_conversion_tools is called during modular tool registration, which in turn registers google_ads_update_conversion_action via the @mcp.tool() decorator.
_TOOL_MODULES = [ ("campaigns", "tools.campaigns.mcp_tools_campaigns", "register_campaign_tools"), ("ad_groups", "tools.ad_groups.mcp_tools_ad_groups", "register_ad_group_tools"), ("keywords", "tools.keywords.mcp_tools_keywords", "register_keyword_tools"), ("ads", "tools.ads.mcp_tools_ads", "register_ad_tools"), ("bidding", "tools.bidding.mcp_tools_bidding", "register_bidding_tools"), ("automation", "tools.automation.mcp_tools_automation", "register_automation_tools"), ("audiences", "tools.audiences.mcp_tools_audiences", "register_audience_tools"), ("conversions", "tools.conversions.mcp_tools_conversions", "register_conversion_tools"), ("reporting", "tools.reporting.mcp_tools_reporting", "register_reporting_tools"), ("insights", "tools.insights.mcp_tools_insights", "register_insights_tools"), ("batch", "tools.batch.mcp_tools_batch", "register_batch_tools"), ("shopping_pmax", "tools.shopping_pmax.mcp_tools_shopping_pmax", "register_shopping_pmax_tools"), ("extensions", "tools.extensions.mcp_tools_extensions", "register_extension_tools"), ("local_app", "tools.local_app.mcp_tools_local_app", "register_local_app_tools"), ] def _register_all_modular_tools(): """Import and register every modular tool module.""" import importlib registered = 0 for label, module_path, func_name in _TOOL_MODULES: try: mod = importlib.import_module(module_path) register_fn = getattr(mod, func_name) register_fn(mcp) logger.info(f" ✓ {label}") registered += 1 except Exception as exc: logger.error(f" ✗ {label}: {exc}") logger.info(f"Registered {registered}/{len(_TOOL_MODULES)} modular tool modules")