Skip to main content
Glama
johnoconnor0

Google Ads MCP Server

by johnoconnor0

google_ads_list_bidding_strategies

Retrieve all portfolio bidding strategies in your Google Ads account with basic info using a customer ID.

Instructions

List all portfolio bidding strategies in the account.

Args: customer_id: Customer ID (without hyphens)

Returns: List of all portfolio bidding strategies with basic info

Example: google_ads_list_bidding_strategies( customer_id="1234567890" )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customer_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the google_ads_list_bidding_strategies tool. It runs a GAQL query to fetch all portfolio bidding strategies from Google Ads, parses the response, logs the operation, and returns a formatted markdown list of strategies.
    @mcp.tool()
    def google_ads_list_bidding_strategies(
        customer_id: str
    ) -> str:
        """
        List all portfolio bidding strategies in the account.
    
        Args:
            customer_id: Customer ID (without hyphens)
    
        Returns:
            List of all portfolio bidding strategies with basic info
    
        Example:
            google_ads_list_bidding_strategies(
                customer_id="1234567890"
            )
        """
        with performance_logger.track_operation('list_bidding_strategies', customer_id=customer_id):
            try:
                client = get_auth_manager().get_client()
                ga_service = client.get_service("GoogleAdsService")
    
                query = """
                    SELECT
                        bidding_strategy.id,
                        bidding_strategy.name,
                        bidding_strategy.type,
                        bidding_strategy.campaign_count,
                        bidding_strategy.target_cpa.target_cpa_micros,
                        bidding_strategy.target_roas.target_roas,
                        bidding_strategy.target_impression_share.target_impression_share
                    FROM bidding_strategy
                """
    
                response = ga_service.search(customer_id=customer_id, query=query)
    
                strategies = []
                for row in response:
                    strategy = row.bidding_strategy
                    strategies.append({
                        'id': str(strategy.id),
                        'name': strategy.name,
                        'type': strategy.type.name,
                        'campaign_count': strategy.campaign_count
                    })
    
                # Audit log
                audit_logger.log_api_call(
                    customer_id=customer_id,
                    operation="list_bidding_strategies",
                    resource_type="bidding_strategy",
                    action="read",
                    result="success",
                    details={'strategy_count': len(strategies)}
                )
    
                if not strategies:
                    return "No portfolio bidding strategies found. Create one with `google_ads_create_bidding_strategy`."
    
                # Format response
                output = f"# Portfolio Bidding Strategies\n\n"
                output += f"**Total Strategies**: {len(strategies)}\n\n"
    
                for strategy in strategies:
                    output += f"## {strategy['name']}\n"
                    output += f"- **ID**: {strategy['id']}\n"
                    output += f"- **Type**: {strategy['type']}\n"
                    output += f"- **Campaigns Using**: {strategy['campaign_count']}\n\n"
    
                return output
    
            except Exception as e:
                error_msg = ErrorHandler.handle_error(e, context="list_bidding_strategies")
                return f"❌ Failed to list bidding strategies: {error_msg}"
  • The registration function that registers all bidding tools (including google_ads_list_bidding_strategies via @mcp.tool() decorator) with the MCP server.
    def register_bidding_tools(mcp):
        """Register all bidding strategy management tools with the MCP server.
  • The master tool registration table listing the bidding module path and registration function name, which causes register_bidding_tools to be called.
    _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"),
    ]
  • The function that dynamically imports and invokes each tool module's registration function, including register_bidding_tools for bidding.
    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")
  • The schema is defined inline via the function signature: customer_id (str) is the only parameter. The return type is str. The docstring provides the schema description.
    @mcp.tool()
    def google_ads_list_bidding_strategies(
        customer_id: str
    ) -> str:
Behavior3/5

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

With no annotations, the description carries full burden. It states the action and scope ('list all portfolio strategies') but does not disclose read-only nature, rate limits, pagination, or that it returns only basic info. This is minimal but adequate for a simple listing 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 with an Args/Returns/Example structure. It is front-loaded with the main action. Minor redundancy: the Returns line repeats info likely in the output schema.

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?

For a simple list tool with an output schema, the description is largely sufficient. However, it lacks usage context (e.g., when to use vs get details) and does not mention any required prior setup or permissions.

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 explains customer_id as 'Customer ID (without hyphens)', adding a formatting hint beyond the schema's title ('Customer Id'). Despite schema coverage of 0%, this single parameter is well-described.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all portfolio bidding strategies in the account, using a specific verb ('List') and resource ('portfolio bidding strategies'). It differentiates from sibling tools like create or get_bidding_strategy_details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for listing all strategies but provides no explicit when-to-use or when-not-to-use guidance. It does not mention alternatives like get_bidding_strategy_details or prerequisites such as account initialization.

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