Skip to main content
Glama
johnoconnor0

Google Ads MCP Server

by johnoconnor0

google_ads_recommendations

Improve campaign performance by retrieving Google's automated recommendations for keywords, bid adjustments, and budgets.

Instructions

Get AI-powered optimization recommendations from Google.

Retrieve Google's automated recommendations for improving campaign performance, including keyword suggestions, bid adjustments, and budget recommendations.

Args: customer_id: Customer ID without hyphens recommendation_types: Filter by recommendation types (e.g., ['KEYWORD', 'TARGET_CPA_OPT']) limit: Maximum number of recommendations (1-100) response_format: Output format: 'markdown' or 'json'

Returns: List of actionable optimization recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customer_idYes
recommendation_typesNo
limitNo
response_formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function that queries Google Ads recommendations via GAQL, filters by type, and returns formatted results in markdown or JSON.
    @mcp.tool()
    def google_ads_recommendations(
        customer_id: str,
        recommendation_types: Optional[List[str]] = None,
        limit: int = 20,
        response_format: str = "markdown",
    ) -> str:
        """
        Get AI-powered optimization recommendations from Google.
    
        Retrieve Google's automated recommendations for improving campaign performance,
        including keyword suggestions, bid adjustments, and budget recommendations.
    
        Args:
            customer_id: Customer ID without hyphens
            recommendation_types: Filter by recommendation types
                (e.g., ['KEYWORD', 'TARGET_CPA_OPT'])
            limit: Maximum number of recommendations (1-100)
            response_format: Output format: 'markdown' or 'json'
    
        Returns:
            List of actionable optimization recommendations
        """
        try:
            client = get_auth_manager().get_client()
            ga_service = client.get_service("GoogleAdsService")
            clean_id = customer_id.replace("-", "")
    
            query = (
                "SELECT recommendation.resource_name, recommendation.type, "
                "recommendation.impact, recommendation.campaign "
                "FROM recommendation "
                "WHERE recommendation.dismissed = FALSE"
            )
    
            if recommendation_types:
                types_str = ", ".join(f"'{t}'" for t in recommendation_types)
                query += f" AND recommendation.type IN ({types_str})"
    
            query += f" LIMIT {min(max(limit, 1), 100)}"
    
            response = ga_service.search(customer_id=clean_id, query=query)
    
            recs = []
            for row in response:
                recs.append({
                    "type": row.recommendation.type.name,
                    "campaign": row.recommendation.campaign or "Account-level",
                    "impact": str(row.recommendation.impact),
                })
    
            if response_format == "json":
                return json.dumps(recs, indent=2, default=str)
    
            out = f"# Optimization Recommendations\n\n"
            out += f"**Total**: {len(recs)}\n\n"
            out += "| Type | Campaign | Impact |\n"
            out += "|------|----------|--------|\n"
            for r in recs:
                out += f"| {r['type']} | {r['campaign'][:30]} | {r['impact'][:50]} |\n"
            return out
    
        except Exception as exc:
            return f"❌ Recommendations query failed: {exc}"
  • Registered as an MCP tool via the @mcp.tool() decorator on the FastMCP instance.
    @mcp.tool()
    def google_ads_recommendations(
        customer_id: str,
        recommendation_types: Optional[List[str]] = None,
        limit: int = 20,
        response_format: str = "markdown",
    ) -> str:
Behavior2/5

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

Annotations are absent, so the description should fully disclose behavior. It only states it returns a list of recommendations, without mentioning pagination, rate limits, or read-only nature. This is insufficient for a mutation-free tool.

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 concise but includes an args section that largely repeats the schema. It is front-loaded with the main purpose but could be tighter.

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 the tool has 4 parameters and no annotations, the description covers parameter semantics adequately and mentions return type. However, it lacks behavioral context and differentiation from siblings, making it minimally viable.

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?

The description adds meaningful details beyond the schema titles, such as customer_id format ('without hyphens'), example recommendation types, limit range (1-100), and response_format values ('markdown' or 'json'). This compensates for the 0% schema 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 it retrieves recommendations using 'Get AI-powered optimization recommendations', but it does not differentiate from the sibling tool 'google_ads_get_recommendations' which likely has similar functionality.

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 is provided on when to use this tool versus alternatives like google_ads_get_recommendations, apply_recommendation, or others. The description does not mention when not to use it.

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