Skip to main content
Glama
googleanalytics

Google Analytics MCP Server

Official

List links to Google Ads accounts

list_google_ads_links

Retrieve linked Google Ads accounts for a Google Analytics property by providing the property ID.

Instructions

Returns a list of links to Google Ads accounts for a property.

Args:
    property_id: The Google Analytics property ID. Accepted formats are:
      - A number
      - A string consisting of 'properties/' followed by a number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
property_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'list_google_ads_links' MCP tool. It is decorated with @mcp.tool() for registration and implements the logic to fetch Google Ads links for a specified property using the Google Analytics Admin API v1beta.
    @mcp.tool(title="List links to Google Ads accounts")
    async def list_google_ads_links(property_id: int | str) -> List[Dict[str, Any]]:
        """Returns a list of links to Google Ads accounts for a property.
    
        Args:
            property_id: The Google Analytics property ID. Accepted formats are:
              - A number
              - A string consisting of 'properties/' followed by a number
        """
        request = admin_v1beta.ListGoogleAdsLinksRequest(
            parent=construct_property_rn(property_id)
        )
        # Uses an async list comprehension so the pager returned by
        # list_google_ads_links retrieves all pages.
        links_pager = await create_admin_api_client().list_google_ads_links(
            request=request
        )
        all_pages = [proto_to_dict(link_page) async for link_page in links_pager]
        return all_pages
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation ('Returns a list'), which implies non-destructive behavior, but doesn't cover important aspects like authentication needs, rate limits, error handling, or response format. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 appropriately sized and front-loaded: the first sentence clearly states the purpose, followed by parameter details. There's no wasted text. However, it could be slightly more structured with bullet points for the format examples, but this is minor.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no nested objects) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the purpose and parameter semantics well. The main gap is the lack of behavioral context (e.g., authentication, errors), but the output schema reduces the need for return value explanation.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds substantial meaning beyond the input schema. The schema has 0% description coverage and only indicates 'property_id' is required with integer/string types. The description explains what 'property_id' represents ('The Google Analytics property ID') and provides specific format examples ('A number' or 'A string consisting of 'properties/' followed by a number'), which is crucial for correct usage.

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 the tool's purpose: 'Returns a list of links to Google Ads accounts for a property.' It specifies the verb ('Returns a list'), resource ('links to Google Ads accounts'), and scope ('for a property'). However, it doesn't explicitly differentiate from sibling tools like 'get_property_details' or 'run_report', which prevents a score of 5.

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. It doesn't mention sibling tools, prerequisites, or specific contexts for usage. The only implied usage is retrieving Google Ads links for a property, but no explicit when/when-not instructions are given.

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/googleanalytics/google-analytics-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server