Skip to main content
Glama
johnoconnor0

Google Ads MCP Server

by johnoconnor0

google_ads_get_bidding_strategy_details

Retrieve the complete configuration and settings of a portfolio bidding strategy to analyze or adjust its performance.

Instructions

Get full configuration details for a portfolio bidding strategy.

Args: customer_id: Customer ID (without hyphens) bidding_strategy_id: Bidding strategy ID

Returns: Complete strategy configuration and settings

Example: google_ads_get_bidding_strategy_details( customer_id="1234567890", bidding_strategy_id="12345" )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customer_idYes
bidding_strategy_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'google_ads_get_bidding_strategy_details' tool. It accepts customer_id and bidding_strategy_id, queries the Google Ads API via GoogleAdsService, and formats the response with strategy configuration details (name, ID, type, campaign count, target CPA/ROAS/impression share, enhanced CPC).
    @mcp.tool()
    def google_ads_get_bidding_strategy_details(
        customer_id: str,
        bidding_strategy_id: str
    ) -> str:
        """
        Get full configuration details for a portfolio bidding strategy.
    
        Args:
            customer_id: Customer ID (without hyphens)
            bidding_strategy_id: Bidding strategy ID
    
        Returns:
            Complete strategy configuration and settings
    
        Example:
            google_ads_get_bidding_strategy_details(
                customer_id="1234567890",
                bidding_strategy_id="12345"
            )
        """
        with performance_logger.track_operation('get_bidding_strategy_details', customer_id=customer_id):
            try:
                client = get_auth_manager().get_client()
                ga_service = client.get_service("GoogleAdsService")
    
                query = f"""
                    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,
                        bidding_strategy.target_impression_share.location,
                        bidding_strategy.target_impression_share.cpc_bid_ceiling_micros,
                        bidding_strategy.enhanced_cpc
                    FROM bidding_strategy
                    WHERE bidding_strategy.id = {bidding_strategy_id}
                """
    
                response = ga_service.search(customer_id=customer_id, query=query)
                results = list(response)
    
                if not results:
                    return f"❌ Bidding strategy {bidding_strategy_id} not found"
    
                row = results[0]
                strategy = row.bidding_strategy
    
                # Audit log
                audit_logger.log_api_call(
                    customer_id=customer_id,
                    operation="get_bidding_strategy_details",
                    resource_type="bidding_strategy",
                    resource_id=bidding_strategy_id,
                    action="read",
                    result="success"
                )
    
                # Format response
                output = f"# Bidding Strategy Details\n\n"
                output += f"**Name**: {strategy.name}\n"
                output += f"**ID**: {strategy.id}\n"
                output += f"**Type**: {strategy.type.name}\n"
                output += f"**Campaigns Using**: {strategy.campaign_count}\n\n"
    
                output += f"## Configuration\n\n"
    
                if strategy.type.name == 'TARGET_CPA':
                    output += f"**Target CPA**: ${strategy.target_cpa.target_cpa_micros / 1_000_000:.2f}\n"
    
                elif strategy.type.name == 'TARGET_ROAS':
                    output += f"**Target ROAS**: {strategy.target_roas.target_roas:.2f}x ({strategy.target_roas.target_roas * 100:.0f}%)\n"
    
                elif strategy.type.name == 'TARGET_IMPRESSION_SHARE':
                    output += f"**Target Impression Share**: {strategy.target_impression_share.target_impression_share * 100:.0f}%\n"
                    output += f"**Location**: {strategy.target_impression_share.location.name}\n"
                    if strategy.target_impression_share.cpc_bid_ceiling_micros:
                        output += f"**Max CPC Bid**: ${strategy.target_impression_share.cpc_bid_ceiling_micros / 1_000_000:.2f}\n"
    
                elif strategy.type.name == 'MANUAL_CPC':
                    output += f"**Enhanced CPC**: {'Enabled' if strategy.enhanced_cpc else 'Disabled'}\n"
    
                return output
    
            except Exception as e:
                error_msg = ErrorHandler.handle_error(e, context="get_bidding_strategy_details")
                return f"❌ Failed to get bidding strategy details: {error_msg}"
  • The registration function 'register_bidding_tools' that is called to register all bidding tools (including google_ads_get_bidding_strategy_details) with the MCP server via @mcp.tool() decorator.
    def register_bidding_tools(mcp):
        """Register all bidding strategy management tools with the MCP server.
    
        Args:
            mcp: FastMCP server instance
        """
  • Top-level registration mapping that ties the 'bidding' module to 'tools.bidding.mcp_tools_bidding.register_bidding_tools', which is dynamically imported and invoked during MCP server startup.
    _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 signature serves as the schema/type definition for the tool's inputs: customer_id (str) and bidding_strategy_id (str), with return type str.
    def google_ads_get_bidding_strategy_details(
        customer_id: str,
        bidding_strategy_id: str
    ) -> str:
        """
        Get full configuration details for a portfolio bidding strategy.
    
        Args:
            customer_id: Customer ID (without hyphens)
            bidding_strategy_id: Bidding strategy ID
    
        Returns:
            Complete strategy configuration and settings
    
        Example:
            google_ads_get_bidding_strategy_details(
                customer_id="1234567890",
                bidding_strategy_id="12345"
            )
        """
  • Supporting imports and utilities used by the handler: BiddingStrategyManager, ErrorHandler, performance_logger, audit_logger, auth_manager, and cache_manager.
    from typing import Optional, List, Dict, Any
    from managers.bidding_strategy_manager import (
        BiddingStrategyManager,
        BiddingStrategyConfig,
        BiddingStrategyType,
        ImpressionShareLocation,
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states the tool returns 'complete strategy configuration and settings' but fails to mention that it is a read-only operation, any required permissions, or potential side effects. The description lacks sufficient transparency.

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

Conciseness5/5

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

The description is compact and well-structured with a clear header sentence, followed by Args, Returns, and Example. Every sentence serves a purpose, and the key information is front-loaded.

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?

With an output schema present, the description does not need to detail return values. However, given the tool's complexity (retrieving full configuration details), the description is minimal. It could mention the scope of configuration details (e.g., name, type, settings) to improve completeness. Nonetheless, it is adequate for a simple retrieval tool.

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

Parameters2/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 compensate. It lists the two parameters in the Args section but adds no additional meaning beyond what the schema already provides (names and types). The description does not explain the format of customer_id (without hyphens is stated) or what a bidding_strategy_id looks like, but the example provides a hint.

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 verb 'Get' and the resource 'portfolio bidding strategy', specifying 'full configuration details'. This distinguishes it from sibling tools like get_bidding_strategy_performance (performance data) and list_bidding_strategies (listing strategies).

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

Usage Guidelines4/5

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

The description provides clear context with Args, Returns, and an Example, specifying the required parameters (customer_id, bidding_strategy_id). However, it does not explicitly state when to use this tool versus alternatives, nor does it 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