Skip to main content
Glama
johnoconnor0

Google Ads MCP Server

by johnoconnor0

google_ads_get_conversion_performance

Retrieve conversion performance metrics for Google Ads campaigns. Accepts customer ID, optional conversion action ID, and date range.

Instructions

Get conversion performance metrics.

Args: customer_id: Customer ID (without hyphens) conversion_action_id: Optional specific conversion date_range: Date range

Returns: Conversion performance data

Example: google_ads_get_conversion_performance( customer_id="1234567890", date_range="LAST_30_DAYS" )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customer_idYes
conversion_action_idNo
date_rangeNoLAST_30_DAYS

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler that registers and implements the google_ads_get_conversion_performance tool. It calls conversion_manager.get_conversion_performance() and formats the results as a markdown string.
    @mcp.tool()
    def google_ads_get_conversion_performance(
        customer_id: str,
        conversion_action_id: Optional[str] = None,
        date_range: str = "LAST_30_DAYS"
    ) -> str:
        """
        Get conversion performance metrics.
    
        Args:
            customer_id: Customer ID (without hyphens)
            conversion_action_id: Optional specific conversion
            date_range: Date range
    
        Returns:
            Conversion performance data
    
        Example:
            google_ads_get_conversion_performance(
                customer_id="1234567890",
                date_range="LAST_30_DAYS"
            )
        """
        with performance_logger.track_operation('get_conversion_performance', customer_id=customer_id):
            try:
                client = get_auth_manager().get_client()
                conversion_manager = ConversionManager(client)
    
                conversions = conversion_manager.get_conversion_performance(
                    customer_id,
                    conversion_action_id,
                    date_range
                )
    
                # Audit log
                audit_logger.log_api_call(
                    customer_id=customer_id,
                    operation="get_conversion_performance",
                    resource_type="conversion_action",
                    action="read",
                    result="success",
                    details={'count': len(conversions)}
                )
    
                if not conversions:
                    return "No conversion data found for the specified period."
    
                output = f"# Conversion Performance\n\n"
                output += f"**Date Range**: {date_range}\n"
                output += f"**Conversions**: {len(conversions)}\n\n"
    
                for conv in conversions:
                    output += f"## {conv['name']} ({conv['category']})\n\n"
                    output += f"- **Conversions**: {conv['conversions']:.1f}\n"
                    output += f"- **Conversion Value**: ${conv['conversions_value']:,.2f}\n"
                    output += f"- **Cost per Conversion**: ${conv['cost_per_conversion']:.2f}\n"
                    output += f"- **Conversion Rate**: {conv['conversion_rate'] * 100:.2f}%\n"
                    output += f"- **Value per Conversion**: ${conv['value_per_conversion']:.2f}\n"
                    output += f"- **All Conversions**: {conv['all_conversions']:.1f}\n\n"
    
                return output
    
            except Exception as e:
                error_msg = ErrorHandler.handle_error(e, context="get_conversion_performance")
                return f"❌ Failed to get conversion performance: {error_msg}"
  • The backend helper method on ConversionManager that runs the GAQL query against the Google Ads API to fetch conversion performance metrics (conversions, conversions_value, cost_per_conversion, conversion_rate, value_per_conversion, all_conversions).
    def get_conversion_performance(
        self,
        customer_id: str,
        conversion_action_id: Optional[str] = None,
        date_range: str = "LAST_30_DAYS"
    ) -> List[Dict[str, Any]]:
        """Get conversion performance metrics.
    
        Args:
            customer_id: Customer ID (without hyphens)
            conversion_action_id: Optional specific conversion action
            date_range: Date range
    
        Returns:
            List of conversion performance data
        """
        ga_service = self.client.get_service("GoogleAdsService")
    
        query = f"""
            SELECT
                conversion_action.id,
                conversion_action.name,
                conversion_action.category,
                metrics.conversions,
                metrics.conversions_value,
                metrics.cost_per_conversion,
                metrics.conversions_from_interactions_rate,
                metrics.value_per_conversion,
                metrics.all_conversions,
                metrics.all_conversions_value
            FROM conversion_action
            WHERE segments.date DURING {date_range}
        """
    
        if conversion_action_id:
            query += f" AND conversion_action.id = {conversion_action_id}"
    
        response = ga_service.search(customer_id=customer_id, query=query)
    
        conversions = []
        for row in response:
            conversions.append({
                'conversion_action_id': str(row.conversion_action.id),
                'name': row.conversion_action.name,
                'category': row.conversion_action.category.name,
                'conversions': row.metrics.conversions,
                'conversions_value': row.metrics.conversions_value,
                'cost_per_conversion': row.metrics.cost_per_conversion,
                'conversion_rate': row.metrics.conversions_from_interactions_rate,
                'value_per_conversion': row.metrics.value_per_conversion,
                'all_conversions': row.metrics.all_conversions,
                'all_conversions_value': row.metrics.all_conversions_value
            })
    
        return conversions
  • Registration entry in _TOOL_MODULES that maps the conversions module to its register_conversion_tools function, which gets called by _register_all_modular_tools().
    ("conversions",   "tools.conversions.mcp_tools_conversions",     "register_conversion_tools"),
  • The registration function that decorates the handler with @mcp.tool(), defining the tool's input schema (customer_id, conversion_action_id, date_range) and output type (str).
    def register_conversion_tools(mcp):
        """Register all conversion tracking tools with the MCP server.
    
        Args:
            mcp: FastMCP server instance
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 merely says 'Get conversion performance metrics' and returns data, but does not state if the operation is read-only, requires specific permissions, or has any side effects. The return format is vague ('Conversion performance data').

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?

The description is relatively concise, using a docstring format with arguments, returns, and an example. It is front-loaded with the purpose, though the example and returns sections add some redundancy.

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?

Given 3 parameters and no nested objects, the description includes an example but does not leverage the existing output schema to explain results. It omits prerequisites like account access or rate limits, which are not covered by any annotations.

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%, meaning the description must add value. It provides extra context for 'customer_id' (without hyphens) and 'conversion_action_id' (optional specific conversion), which are not in the schema. However, 'date_range' lacks additional meaning beyond the schema default.

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 states 'Get conversion performance metrics', which is a specific verb+resource. However, among many sibling tools with 'conversion' in their name (e.g., google_ads_conversion_summary_report, google_ads_app_conversions), the description does not differentiate this tool from others, lacking sibling distinction.

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 google_ads_conversion_summary_report or other performance reports. It lacks explicit context for selection or exclusions.

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